Closed
Description
I'd like to make use of the navigation callbacks onBeforeNavigation
and onNavigation
within a mounted contextual router. It works fine when I add the callback to the main router, however when I use it within a contextual router mounted under another router, the callbacks don't get called.
Modified example:
var App = React.createClass({
handleNavigation: function() {
console.log( 'works great' );
},
render: function() {
return (
<Locations onBeforeNavigation={this.handleNavigation}>
<Location path="/" handler={MainPage} />
<Location path="/photos(/*)" handler={Photos} />
</Locations>
)
}
})
var Photos = React.createClass({
handleNavigation: function() {
console.log( 'does not get triggered' );
},
render: function() {
return (
<Locations contextual onBeforeNavigation={this.handleNavigation}>
<Location path="/" handler={AlbumPage} />
<Location path="/:slug" handler={PhotoPage} />
</Locations>
)
}
})
Metadata
Metadata
Assignees
Labels
No labels