As a result, we created a hacker solution: we call the following when the redirection should occur, where path is something like /questions/23 .
// call an event to get the router from somewhere else that listening // to this event specifically to provide the router document.dispatchEvent(new CustomEvent('router.get', { detail: { callback: function(router) { router.navigate(path); } } }));
Then, in the router, an event listener:
var App = React.createClass({ listenForRouter: function listenForRouter () { var self = this; document.addEventListener('router.get', function(e) { setTimeout(function() { e.detail.callback(self .refs.router .refs.locations); }, 1); }); }, componentDidMount: function componentDidMount () { this.listenForRouter(); },
Logan howard
source share