-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Handle special props ref
and key
in path and search params
#5537
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jtoar
added
topic/router-&-navigation
release:fix
This PR is a fix
action/add-to-discussion-queue
labels
May 14, 2022
✅ Deploy Preview for redwoodjs-docs canceled.
|
jtoar
force-pushed
the
ds-coerce-ref-search-param-to-referrer
branch
from
August 29, 2022 12:44
9a3e15b
to
b8dd4e3
Compare
Tobbe
reviewed
Aug 30, 2022
Should we have a lint rule to make sure no one tries to have a route like |
@Tobbe yeah that seems like the way to go. What should we do if the lint rule isn't heeded though? The router should probably fail in dev right? And in production? I still haven't thought it through |
CI is failing because there's type error on |
jtoar
changed the title
Check for reserved names in search params
Handle special props Sep 3, 2022
key
and ref
in path and search params
jtoar
changed the title
Handle special props
Handle special props Sep 3, 2022
key
and ref
in path and search paramsref
and key
in path and search params
This reverts commit b8dd4e3.
Co-authored-by: Tobbe Lundberg <tobbe@tlundberg.com>
jtoar
force-pushed
the
ds-coerce-ref-search-param-to-referrer
branch
from
September 3, 2022 08:22
ab0fc44
to
76020e1
Compare
Tobbe
reviewed
Sep 3, 2022
Tobbe
reviewed
Sep 3, 2022
Tobbe
reviewed
Sep 3, 2022
Co-authored-by: Tobbe Lundberg <tobbe@tlundberg.com>
Co-authored-by: Tobbe Lundberg <tobbe@tlundberg.com>
Co-authored-by: Tobbe Lundberg <tobbe@tlundberg.com>
jtoar
added a commit
that referenced
this pull request
Sep 5, 2022
Co-authored-by: Tobbe Lundberg <tobbe@tlundberg.com>
jtoar
added a commit
that referenced
this pull request
Sep 8, 2022
Co-authored-by: Tobbe Lundberg <tobbe@tlundberg.com>
dac09
added a commit
to dac09/redwood
that referenced
this pull request
Sep 9, 2022
* 'main' of github.com:redwoodjs/redwood: fix(deps): update dependency @graphql-yoga/common to v2.12.12 (redwoodjs#6349) fix(test-project): revert @redwoodjs/core to rc Update yarn.lock v2.2.4 bugfix replace slash in tailwind config on windows (redwoodjs#6203) bugfix replace slash in tailwind config on windows (redwoodjs#6203) chore(deps): update dependency @testing-library/dom to v8.17.1 (redwoodjs#6351) Update yarn.lock Use try/catch to access unauthenticated (redwoodjs#6358) issue#5852 added windows fix for nodeFileTrace (redwoodjs#6325) Handle special props `ref` and `key` in path and search params (redwoodjs#5537) Use try/catch to access unauthenticated (redwoodjs#6358) feat(codemod): Add codemod to make relation resolvers partial (redwoodjs#6342)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #5497. When it comes to the router, it's react components all the way down. The router is a react component; routes are react components; pages are react components. We pass path and search parameters to pages as props, so that you can do things like...
(You can also get
id
from the params context viauseParams
, but destructuring it from props is more convenient.) When a path or search param isref
orkey
, there's an issue. If it'sref
, the component throws since you can only pass the return ofReact.createRef
oruseRef
toref
. Withkey
, nothing happens, but the component consumes the prop and you don't get access to it. It's still accessible viauseParams
, but this isn't super obvious.This PR stops the hard break that happens when
ref
is passed. It also stops the router from passingkey
.