Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 1 month 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 (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-18T22:55:42.000Z (almost 7 years ago)
- Last Synced: 2024-10-11T16:04:22.883Z (about 1 month ago)
- Language: JavaScript
- Size: 25.4 KB
- Stars: 0
- Watchers: 3
- 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);
}
```