Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

ViewPropTypes' is not supported in 'react-native-web' v12.0 onwards #131

Closed
markybry opened this issue Sep 24, 2020 · 2 comments · Fixed by #138
Closed

ViewPropTypes' is not supported in 'react-native-web' v12.0 onwards #131

markybry opened this issue Sep 24, 2020 · 2 comments · Fixed by #138

Comments

@markybry
Copy link

If you upgrade to RNW 12.0 or greater you can no longer use react native web

Error: ./node_modules/react-native-table-component/components/rows.js
Cannot find module: 'react-native-web/dist/exports/ViewPropTypes'. Make sure this package is installed.

@Dammic
Copy link

Dammic commented Oct 5, 2020

As I think this might not get fixed quickly, in the meantime I've prepared my own, slightly hacky workaround:
In ./scripts/fix-rn-web-proptypes-issue.sh:

#!/bin/bash

echo 'Fixing PropTypes issue related to react-native-table-component...'
for file in ./node_modules/react-native-table-component/components/*.js; do
    sed -i '/ViewPropTypes\.style/g' $file
    sed -i '/Text\.propTypes/g' $file
done
echo 'PropTypes issue fixed!'

And then in package.json:

scripts: {
    "postinstall": "sh ./scripts/fix-rn-web-proptypes-issue.sh"
}

The problem is just with propTypes, the rest appears to bo working fine.

@andyasberry
Copy link

Implemented fixes from #138 in a forked repo and published as a new npm package. See this comment for more details: #141 (comment)

Don't plan on maintaining/supporting it, but hopefully it will help anyone who is trying to get over this hump.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants