react-router-historyjs-location

0.0.1 • Public • Published

react-router-historyjs-location

By default if you try to use HistoryLocation in react-router on a browser that does not support it, it falls back to RefreshLocation. Maybe you don't want this (for example, displaying UI state). This shim lets you use window.History (provided by history.js) as a location in react-router.

Usage

history.js is not packaged to allow it to be pulled in through a require() statement, so this library assumes that History.js is loaded on the page and that window.History is defined.

document.addEventListener('DOMContentLoaded', function() {
    var HistoryJsLocation = require('react-router-historyjs-location');
    Router.run(routes, HistoryJsLocation, function (Handler) {
        React.render(<Handler/>, document.body);
    });
});

Package Sidebar

Install

npm i react-router-historyjs-location

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • tildedave