internal-link-router

1.0.0 • Public • Published

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

function startApp (routes) {
    ReactDOM.render((
        <Provider store={store}>
            <InternalLinkRouter>
                <Route path='/login' component={LoginLayout} />
                { /* all your other routes */ }
            </InternalLinkRouter>
        </Provider>
    ), container);
}

Readme

Keywords

Package Sidebar

Install

npm i internal-link-router

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

100 kB

Total Files

8

Last publish

Collaborators

  • sakabako