-
-
Notifications
You must be signed in to change notification settings - Fork 15.2k
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
With react-router, redux will not work. #136
Comments
Can you attach a gist? |
|
Including the router 😉 |
|
You must pass the |
@ooflorent i update super(props, context), it always report the same error. |
It won't work this way with Router 1.0, until React 0.14 comes out. Top-level route handler ( In the meantime, you need to wrap |
@ustccjw this should help you to understand emmenko/redux-react-router-async-example@c8e886f The places to pay attention are:
{React.cloneElement(this.props.children, { actions })} |
Let's create a dedicated FAQ in the docs (separate from README) and put RR integration instructions there. Anybody want to do that? |
@gaearon I can do it, i will try my best. |
@emmenko thanks, i learn a lot. |
@gaearon I can do a PR later |
@ustccjw glad to help :) |
@ustccjw to be fair, I haven't tried hot reloading in my example. What exactly is not working? Is it working without RR? |
To have hot reloading properly working, you'll need to have a root component that returns If you import stores in |
@gaearon you are right, it works! But react-router will throw error: |
Thanks for reporting! class AppContainer extends Component {
constructor(props) {
this.history = new BrowserHistory();
super(props);
}
render() {
return (
<Provider>{() =>
<Router history={this.history}>
...
</Router>
}</Provider>
);
} @mjackson @ryanflorence No plans to support swapping |
@gaearon Thanks! You are great, I will to learn more from you! ps.
|
Right. |
@emmenko Can you please fix your RR project so hot reloading works taking this comment into account? #136 (comment) |
@gaearon sure, I wanted to make it work first without HR, I'll do that as a second step |
Not sure if this is related... and/or I am stuck waiting for React final 0.14.. I am currently using 0.14 rc1. I would like to render a top header, bottom footer and then have my router paths render in between the header and footer areas.. the content area. However, my header is a top menu bar, with <Link...> elements in it.. and every time I use those, I get some sort of infinite loop happening and my entire browser halts.. I have to force quit it. I assume this has something to do with that the header and footer components are rendered outside of the Provider? Is there some way to make the Link element (or even an element) work to change the content area of my page to the specified routed path/component? I would be fine with header/footer as well as content area inside the Provider tag.. but when I do that, the entire page gets redrawn including header/footer every time I click a link, and I am still stuck with the not working and crashing browser in the header component. In other words, I am still not quite clear on the proper setup/integration of components with Redux and router. :) Appreciate any help on this. |
Sorry, it is very hard what goes wrong in your particular case but I assure you it is not combining Redux and React Router itself that is the problem, but rather a mistake in using either of them (or something else entirely). Please consult |
@gaearon Thanks! I tried your code and now I get a different error:
|
I'm a flummox's user, as @acdlite suggest, i try to use redux.
I use react-router v1.0-beta2, I found when I use {this.props.children} to use 'component of redux', @connect, then will report error:
Failed Context Types: Required context 'redux' was not specified in 'Connector'. Check the render method of 'Connector(DashboardApp)'
It seems react-router disabled the 'redux' context, so what should I do ?
The text was updated successfully, but these errors were encountered: