Skip to content

add "Caveat" section to readme noting how you can't dispatch during componentWillMount on the server #726

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

Closed
wants to merge 6 commits into from

Conversation

faceyspacey
Copy link

@faceyspacey faceyspacey commented Jun 23, 2017

NOTE: I would have recommended other packages as well, but there are no popular Redux-specific routing packages other than Redux First Router that offer server-side data-fetching or route-based data-fetching in general. For example the most popular Redux-specific routing package, Redux Little Router, does not have data-fetching built in. Which means many users might still end up using componentWillMount while using it.

In the future, a short list should be amended here :)

…componentWillMount` on the server

NOTE: I would have added other packages, but there are no popular Redux-specific routing packages other than [Redux First Router](https://medium.com/@faceyspacey/pre-release-redux-first-router-a-step-beyond-redux-little-router-cd2716576aea) that offer server-side data-fetching or route-based data-fetching in general. For example the most popular Redux-specific routing package, *Redux Little Router*, does not have data-fetching built in. Which means many users might still end up using `componentWillMount` while using it.

In the future, a short list should be amended here :)
@timdorr
Copy link
Member

timdorr commented Jun 23, 2017

This seems like odd placement. And the routing stuff is a non-sequitur. Data fetching and dispatching in componentWillMount/constructor isn't a new issue to any version of React Redux and there are many solutions for this. I don't think this adds much value to the Readme.

@timdorr timdorr closed this Jun 23, 2017
@faceyspacey
Copy link
Author

Sure it's easier to do nothing. I've been using react-redux for a long time and never knew this. I just happened to have done the right thing. Newer developers like the one I was talking to im sure fall into this trap all the time. This needs to be written somewhere beyond Issue threads, especially as SSR is going to become even more common.

Id be happy to put it somewhere else and edit it in any way you need.

Is it on the Redux site? The thing is if it is, that site has too much info so it will get buried. Somewhere in this repo seems best to me since this is what it specifically applies to.

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

Successfully merging this pull request may close these issues.

2 participants