Link - add element shape for innerRef #6886
Merged
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.
The
innerRef
property from theLink
component is throwing a warning when using theReact.createRef
API introduced in React 16.3.The warning is the following one:
Warning: Failed prop type: Invalid prop `innerRef` supplied to `Link`. in Link (created by MyComponent)
I am taking the approach suggested here. Basically adding the new shape to the valid types for this property.
Here you have a live example of the warning being thrown when using the
innerRef
prop with thecreateRef
function:https://codesandbox.io/s/react-router-v3-link-ref-ojj07