node package manager
Stop wasting time. Easily manage code sharing in your team. Create a free org »

react-router-historyjs-location

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);
    });
});