Skip to content
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

Fixed Link component prop type check #7276

Merged
merged 2 commits into from
Apr 22, 2020
Merged

Fixed Link component prop type check #7276

merged 2 commits into from
Apr 22, 2020

Conversation

ypyakymiv
Copy link
Contributor

The Link component in react-router-native always throws a warning regarding the type of its component prop when it is not explicitly passed a function. This is because by default component is set to TouchableOpacity, which always fails the propType test in development mode since component: PropTypes.func. Changing the type test to component: PropTypes.oneOfType([PropTypes.func, PropTypes.instanceOf(React.Component)]) preserves the intended behavior and doesn't throw a warning by default.

@timdorr
Copy link
Member

timdorr commented Apr 22, 2020

Thanks!

@timdorr timdorr merged commit e632747 into remix-run:master Apr 22, 2020
@ypyakymiv ypyakymiv deleted the fix-link-type-check-error branch April 22, 2020 02:53
@mjackson
Copy link
Member

Looks good, thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants