Skip to content

Commit 9a587e0

Browse files
committed
React use scroll navigate
1 parent 689c4c3 commit 9a587e0

File tree

7 files changed

+8010
-0
lines changed

7 files changed

+8010
-0
lines changed

.babelrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/preset-env",
5+
{
6+
"targets": "> 0.25%, not dead"
7+
}
8+
]
9+
]
10+
}

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/coverage/
2+
/node_modules/

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# React use scroll navigate
2+
This is a react hook that allows you to navigate to a specific section of a page by scrolling to it.
3+
4+
## Installation
5+
```bash
6+
npm install react-use-scroll-navigate
7+
```
8+
9+
## Usage
10+
```jsx
11+
import useScrollNavigate from 'react-use-scroll-navigate';
12+
13+
const App = () => {
14+
15+
const navgiate = useScrollNavigate();
16+
17+
return (
18+
<div>
19+
<button onClick={ ()=> {navgiate('/') } )}>Go to homepage</button>
20+
</div>
21+
);
22+
};
23+
```
24+
25+
## License
26+
[MIT](https://choosealicense.com/licenses/mit/)
27+
28+
## Contributing
29+
Pull requests are welcome.
30+
For major changes, please open an issue first to discuss what you would like to change.
31+
32+
33+
34+
## Authors and acknowledgment
35+
- [Alexandre BAUDRY](https://github.com/Alexandrebdry)

0 commit comments

Comments
 (0)