-
-
Notifications
You must be signed in to change notification settings - Fork 10.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
Expose params on context? #2278
Comments
This seems like a good idea. Literally the only problem I have is the name |
|
I feel that RR is polluting props and context. I want it to namespace to |
@srph react-router only puts two things into I don't consider it unacceptable to add another |
It's actually documented now: https://facebook.github.io/react/docs/context.html |
s/undocumented/advanced and experimental/ |
Desperately need this for |
I have a top-level |
Thanks 👍, but I would still like to have this out of the box. |
I feel the same, obviously. It's a pretty trivial fix - just want to make sure that we're okay with this change. |
🚥 green light. Go for it @taion. |
Per 9d346fc#commitcomment-13933868 - My first choice would actually be to only have I can revert #2336, but would it make sense to drop |
I would leave |
Yeah /: Should we just back out #2336 then? Personally, it's really the inconsistency that bothered me more than not having access to |
Yeah, just revert that and we can discuss how we want to do it for a post-1.0.0 release. |
closing for now with the |
Eh, on second thought let's just not do this. |
Why not? |
For a use case like 9d346fc#commitcomment-13942354, #2186 is a much better way forward. For something like relative navigation, this doesn't really help anyway without something like #2177 (comment). On its own this change isn't really useful - it's essentially an XY problem, and it'd make more sense to track actual use cases. |
I'm writing a bit of code that uses this and I'm hitting something that touches on #2255, #2261, and #2172.
It's a little bit weird that I can access the current
Location
object fromthis.context.location
, but I can't similarly access the route params via something likethis.context.params
and instead have to explicitly pass those params down.It seems like for consistency it'd be ideal to treat the two identically - for doing something like building a relative
Link
, I'd like to have access in a nested component both to the current URL parameters (fromparams
) and the query parameters (fromlocation
).The text was updated successfully, but these errors were encountered: