Skip to content

Html5 history plugin

Synchronize the router with the browser history / URL.

You simply need to use the html5HistoryPlugin. Under the hood, it is using ReactTraining history.

You need to have history in your dependencies.

shell
> npm install history

Here is an example using ES6 and the MobxRouter.

js
import {html5HistoryPlugin, Router} from 'bard-router'

const router = new Router(/*...*/)
html5HistoryPlugin.register(router)

If needed, you can access the history instance returned by createBrowserHistory at router.history.