I am having issues getting the onChange hook in react-router to work properly. Here is my routes file:
import React from \'react\';
import { Router, Route, brows
onUpdate needs to be declared on the Router
instance not Route
s. Although, Route
s can declare onChange and onEnter hooks - it's probably what you were looking for.
I'm using react-router ^2.4.0 and onUpdate did not work for me. I have instead used onChange on my base Route component.
const Routes = (
<Router history={browserHistory}>
{/* App Routes */}
<Route path="/" component={App} lang={lang} onChange={logUpdate}>
<Route path="/testone" component={TestOne} />
<Route path="/testtwo" component={TestTwo} />
</Route>
</Router>);