https://github.com/stutrek/internal-link-router
A React component that turns clicks on links to routing actions
https://github.com/stutrek/internal-link-router
Last synced: 3 months ago
JSON representation
A React component that turns clicks on links to routing actions
- Host: GitHub
- URL: https://github.com/stutrek/internal-link-router
- Owner: stutrek
- Created: 2018-02-18T22:41:20.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-18T22:55:42.000Z (over 7 years ago)
- Last Synced: 2025-03-20T06:34:06.294Z (4 months ago)
- Language: JavaScript
- Size: 25.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Internal Link Router
This is a React component that wraps your app and intercepts clicks on elements. If there's an href attribute that starts with `/` it will cancel the click and dispatch a react routing event. If there's a hash it will smoothly scroll the specified element into view.
## Basic Usage
```javascript
function startApp (routes) {
ReactDOM.render((
{ /* all your other routes */ }
), container);
}
```