Skip to content

Instantly share code, notes, and snippets.

@silouanwright
Created October 19, 2015 19:29
Show Gist options
  • Save silouanwright/888d4e3e2fff9d361c13 to your computer and use it in GitHub Desktop.
Save silouanwright/888d4e3e2fff9d361c13 to your computer and use it in GitHub Desktop.
Access useRoutes-enhanced history outside of components
var temporaryHistory = useRoutes(createHistory)({
routes: createRoutes(routes)
});
let unlisten = temporaryHistory.listen(function(error, state) {
if (error){
} else {
// Have to set the routes here somehow
console.log(state);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment