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

Version 0.6.0 doesn't work with react-router #43

Closed
smashercosmo opened this issue Aug 9, 2015 · 5 comments
Closed

Version 0.6.0 doesn't work with react-router #43

smashercosmo opened this issue Aug 9, 2015 · 5 comments

Comments

@smashercosmo
Copy link

I'm having rather strange issue in my app. After upgrading to 0.6.0 transitions to routes stoped working. While url in browser is changing the page stays the same. With 1.0.0-alpha everything works fine.

@gaearon
Copy link
Contributor

gaearon commented Aug 9, 2015

It's a very vague description :-). Can you publish a reproducible example?

@smashercosmo
Copy link
Author

@gaearon Ok) Here is an example

@gaearon
Copy link
Contributor

gaearon commented Aug 9, 2015

This is facebook/react#2517 showing its head again.
The easy fix is to always pass props down when the router state changes.

Instead of:

Router.run(routes, Router.HistoryLocation, (Handler) => {
  React.render(
    <Provider store={store}>
      {() => <Handler />}
    </Provider>, document.getElementById('root'));
});

write

Router.run(routes, Router.HistoryLocation, (Handler, props) => { // note "props" here
  React.render(
    <Provider store={store}>
      {() => <Handler {...props} />} // note "props" here
    </Provider>, document.getElementById('root'));
});

We need to document this.

I think this shouldn't affect React Router 1.0 but if you could verify this, it would be nice.

@gaearon
Copy link
Contributor

gaearon commented Aug 9, 2015

Documented in d4ae7b4.

@gaearon gaearon closed this as completed Aug 9, 2015
@smashercosmo
Copy link
Author

thx for the clarification)

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

2 participants