Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation callbacks within mounted contextual router #95

Closed
0nn0 opened this issue Oct 27, 2014 · 4 comments
Closed

Navigation callbacks within mounted contextual router #95

0nn0 opened this issue Oct 27, 2014 · 4 comments

Comments

@0nn0
Copy link

0nn0 commented Oct 27, 2014

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>
    )
  }
})
@ghost
Copy link

ghost commented Nov 20, 2014

+1

@JabX
Copy link

JabX commented Jan 24, 2015

I'm needing this also, it would be a great new feature.

@STRML
Copy link
Owner

STRML commented Jan 24, 2015

Out of the country right now but would be happy to merge a PR with tests.
On Jan 24, 2015 1:31 AM, "Damien Frikha" notifications@github.com wrote:

I'm needing this also, it would be a great new feature.


Reply to this email directly or view it on GitHub
#95 (comment)
.

@STRML STRML closed this as completed in e4f3446 Jun 9, 2016
@STRML
Copy link
Owner

STRML commented Jun 9, 2016

Long time coming, but this is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants