-
Notifications
You must be signed in to change notification settings - Fork 466
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
Attempted import error: 'ViewPropTypes' is not exported from 'react-native-web/dist/index'. #313
Comments
I tried the above fix i.e. adding
|
I ran into the same problem and wound up having to write a patch file using
const ViewPropTypes = typeof document !== 'undefined' || Platform.OS === 'web'
? PropTypes.shape({style: PropTypes.object})
: require('react-native').ViewPropTypes || View.propTypes;
"scripts": {
"postinstall": "patch-package"
} This was what I needed to do so I could get Storybook running under my Expo example app for the project I've been working on. |
#313 (comment) |
Thank you much . You saved my time |
change all |
I ended up removing ViewPropTypes entirely and that got it working with the version of React Native that I'm on (0.69.6) |
Simple solution here:
In Insert But i hope that author will update a package so we don't need this anymore. |
I tried to access the app using Expo Web and got one error in terminal and one in the browser. It seemed to work fine in Android emulator, however.
Terminal error:
Not sure if it's related but, I saw this issue as well, which also mentions HTMLView.js line 149: #311
And this browser error, which would seem to make sense if ViewPropTypes isn't exported any more by react-native-web. Possibly more on that here: necolas/react-native-web#1537
And a possible solution was suggested here: necolas/react-native-web#1537 (comment) (not sure that's the best way or not but, trying to help troubleshoot or at least research. Hope that helps.)
Initial browser error with no visable app/site:
The text was updated successfully, but these errors were encountered: