Skip to content
This repository was archived by the owner on Jan 27, 2023. It is now read-only.

Commit 80a18fa

Browse files
author
Faramaz Pat
committed
update readme
1 parent 29675d0 commit 80a18fa

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1-
Simple router react to keep the scroll of the page and to restore it if the user clicks on the back button of its browser
1+
### Simple react component to keep the scroll of the page and to restore it if the user clicks on the back button of its browser
2+
3+
I did this package because I was frustrated that the new react router (4) does not restore the scroll when I click on the back button of my browser.
4+
5+
only work with react and react router v4
6+
7+
#### import component in your main page
8+
9+
```javascript
10+
import ScrollMemory from 'react-router-scroll-memory';
11+
```
12+
13+
#### add the component after the Router
14+
15+
```jsx
16+
<BrowserRouter>
17+
<ScrollMemory />
18+
<App />
19+
</BrowserRouter>
20+
```
21+
222

3-
for use with react router v4

0 commit comments

Comments
 (0)