Dynamic segments called "key" are silently removed #447
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.
If a dynamic segment is called “key” it will be silently removed from the props.
/some-path/:foo/bar/:key
— would includefoo
in the props passed to the child component but notkey
.The docs state:
I’m assuming that this issue happens due to a clash with React? However, a dynamic segment called e.g.
className
seems to be passed fine.My suggestion would be to either find a way to pass the parameter as any other or include a note in the documentation.
key
might be a more common parameter name than others.Attached is a failing test. Additionally — and maybe easier — you can see the issue here: https://codesandbox.io/s/mystifying-golick-fchxm?file=/src/App.js