-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Adds a note & link to Redux blocked updates #5552
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
Conversation
I read this doc like four times until I decided to click on the breadcrumbs for other guides. Lo and behold, I found and solved my problem within 30 seconds. This PR helps others avoid my situation because it indicates that they should also read the other Redux guide if they are experiencing blocked updates.
I'm not sure this is really necessary. Redux is already mentioned in the third-party code section. Should the solution in that guide be more explicit? I guess a tl;dr could be added. When I wrote that, I wanted to discourage overuse of |
Thx for immediate reply! I think it should at least be linked to somewhere... it was literally a 30 second fix vs. about an hour yesterday. Happy to update this PR... I can add it to the third-party code section. Lemme know what you had in mind. You recommend the passing of |
@benjaminhoffman the fix for blocked updates is just passing a prop that changes when the location changes. When you use const MyComponent = withRouter(connect(...)(AComponent));
<Route path='/somewhere' component={MyComponent} />
/*
* <Route path='/somewhere>
* <withRouter()>
* <Route>
* <connect()>
* <AComponent>
*/
That isn't meant to be a criticism of this PR. The docs aren't doing their job if they aren't providing a clear solution, and the current blocked updates guide takes its time getting to the answer. I'm fine with the link, although I think that posting something like this at the top of this guide might be more useful:
|
@pshrmn ah! Makes sense. I updated the PR with more context -- added your description + two links (one to this thread and the other to redux guide). Although you mentioned to put this at the top, I would hate to have people read just this section then move on. It's probably better they read the page to get educated on the issue and once they hit the solution section, they'll see this discussion. Thoughts? Happy to change it if you think that's better. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As much as I want people to read the guide and understand the problem, I'm fine putting this at the top if it means that it will help more people. Your call, either one is fine with me.
If you do move it to the top, maybe just put the "this is not the most efficient" sentence in bold so that it stands out a little bit more and maybe convinces a few people to read the rest?
Other than that, I'm good with this. Thanks for the PR!
@pshrmn I tried to rework it in the intro but after trying a few copy updates, it just sounded weird / out of context given that it's a redux/mobx related issue. Although, I did bold a sentence in my most recent commit. Nonetheless, always happy to try again / make updates if you'd like! Ready to merge? (I dont see a "merge" option on this PR). |
@benjaminhoffman It looks good to me, but another collaborator needs to OK and merge this. |
Sorry, let's merge this in! |
I might've found a different solution. I don't know if it's going to be the end-all fix, but what about this? |
Thanks! |
I read this doc like four times until I decided to click on the breadcrumbs for other guides. Lo and behold, I found and solved my problem within 30 seconds. This PR helps others avoid my situation because it indicates that they should also read the other Redux guide if they are experiencing blocked updates.