You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
'ViewPropTypes' is not supported in 'react-native-web' v12.0 onwards #41
changed the title [-]Attempted import error: 'ViewPropTypes' is not exported from 'react-native'[/-][+]'ViewPropTypes' is not supported in 'react-native-web' v12.0 onwards[/+]on Feb 25, 2020
So, as the last issue reported, this package no longer works work with the latest react-native-web because ViewPropTypes is deprecated (more on the release note). The Controls, Swiper and Badge files used this method for validation of styles received as props.
The solution is pretty easy, basically use PropTypes.shape() for number, array or object.
change all ViewPropTypes.style to PropTypes.style in the source code
don't forget to import PropTypes from "prop-types";
which requires npm install prop-types
Activity
[-]Attempted import error: 'ViewPropTypes' is not exported from 'react-native'[/-][+]'ViewPropTypes' is not supported in 'react-native-web' v12.0 onwards[/+]kkapilchoubisa commentedon Feb 25, 2020
I was trying to figure out the problem and I found that react-native-web version 12.0 and onwards do not support ViewPropType.
dantenol commentedon Feb 28, 2020
Any updates on how to fix that?
dantenol commentedon Feb 28, 2020
So, as the last issue reported, this package no longer works work with the latest react-native-web because
ViewPropTypesis deprecated (more on the release note). The Controls, Swiper and Badge files used this method for validation of styles received as props.The solution is pretty easy, basically use PropTypes.shape() for number, array or object.
Can i submit a PR for that?
zaferayan commentedon Mar 2, 2020
I forked repo and fixed this issue:
https://github.com/ozcanzaferayan/react-native-web-swiper
wkngau219 commentedon Apr 30, 2020
Hi, any plan to merge ozcanzaferayan's fix and release?
oxyii commentedon May 13, 2020
@ozcanzaferayan Thank you for your help. Changes from your fork already merged as diff.
@kei-ngau @dantenol @kkapilchoubisa Please try
2.1.1oxyii commentedon May 13, 2020
@ozcanzaferayan Can you take this repo (and npm package) for maintaining? #42
flyskywhy commentedon Sep 2, 2020
npm install --save-dev react-app-rewired
Create a
config-overrides.jsin your project rootAlso create a
web/aliases/react-native/index.jsNow you can just run
react-app-rewired startinstead ofreact-scripts startdanzeeeman commentedon Nov 11, 2020
This is still a problem
danzeeeman commentedon Nov 11, 2020
what is the solution? why did something get deprecated when it is still being used in many many packages and examples?
futurk commentedon May 15, 2022
change all
ViewPropTypes.styletoPropTypes.stylein the source codedon't forget to
import PropTypes from "prop-types";which requires
npm install prop-types