-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
[fixed] Now execute willTransition* hooks even if only query part was changed #499
[fixed] Now execute willTransition* hooks even if only query part was changed #499
Conversation
811b22e
to
b080612
Compare
are you saying |
@vladimir-vg Can you please write a test that demonstrates the problem you're trying to address with this PR? |
@rpflorence yes, exactly. Well, And these @mjackson, I will write tests, but cannot do it right now -- probably in 2-3 days, when I reach my computer. |
… changed Previously query change didn't fire hooks. Now does.
b080612
to
c6aa4d3
Compare
@mjackson added test that demonstrates problem. If you comment added changes, test will fail. |
@vladimir-vg ignoring the potential merge of this pull request, you can pass the params/query down your view hierarchy to get the |
wait a sec, look at the master-detail example, https://github.com/rackt/react-router/blob/v0.11.1/examples/master-detail/app.js#L92-L94 That's how it knows to get a different contact from the store. |
oh ... its the query that doesn't trigger Maybe it should. |
@rpflorence Probably I unintentionally mislead you. I actually don't know does it fire According to 0.10 release I'm aware of available workaround. |
[fixed] Now execute willTransition* hooks even if only query part was changed
thanks! |
You're welcome. |
There are a few problems with 0c3c75d, namely:
The first issue isn't a huge one. I can fix it easily. The bigger issue is the second. If we're going to trigger transition hooks when the query changes, we should probably trigger them in every route handler in the hierarchy, not just the leaf route. This makes it even more obvious how the transition hooks are different from If you guys can agree on these points I think I can make a patch today. |
@mjackson As I can see you already fixed the problem. Everything ok now, right? |
@vladimir-vg Yeah, np :) |
Upgraded to 0.11 and discovered that params now passed a bit differently. I had rewritten my app code to use
willTransitionTo
instead of oldcomponentWillReceiveProps
.I'm using query params for filtering results. Surprisingly discovered that now query changes doesn't fire hooks, while still producing transition.
This pull request fixes that.