Handle special props ref and key in path and search params#5537
Merged
Conversation
✅ Deploy Preview for redwoodjs-docs canceled.
|
9a3e15b to
b8dd4e3
Compare
Tobbe
reviewed
Aug 30, 2022
Contributor
|
Should we have a lint rule to make sure no one tries to have a route like |
Contributor
Author
|
@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 |
Contributor
Author
|
CI is failing because there's type error on |
key and ref in path and search params
key and ref in path and search paramsref and key in path and search params
This reverts commit b8dd4e3.
Co-authored-by: Tobbe Lundberg <[email protected]>
ab0fc44 to
76020e1
Compare
Tobbe
reviewed
Sep 3, 2022
Tobbe
reviewed
Sep 3, 2022
Tobbe
reviewed
Sep 3, 2022
Co-authored-by: Tobbe Lundberg <[email protected]>
Co-authored-by: Tobbe Lundberg <[email protected]>
Co-authored-by: Tobbe Lundberg <[email protected]>
jtoar
added a commit
that referenced
this pull request
Sep 5, 2022
Co-authored-by: Tobbe Lundberg <[email protected]>
jtoar
added a commit
that referenced
this pull request
Sep 8, 2022
Co-authored-by: Tobbe Lundberg <[email protected]>
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)
This file contains hidden or 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
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
idfrom the params context viauseParams, but destructuring it from props is more convenient.) When a path or search param isreforkey, there's an issue. If it'sref, the component throws since you can only pass the return ofReact.createReforuseReftoref. 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
refis passed. It also stops the router from passingkey.