Error when adding to react native web project
See original GitHub issueI follow tutorial to add react-native-web
to react-native
project. but
I got error when adding react-native-vector-icons
to project.
./node_modules/react-native-vector-icons/lib/create-icon-set.js
SyntaxError: /home/hamidreza/Desktop/myApp/node_modules/react-native-vector-icons/lib/create-icon-set.js: Support for the experimental syntax 'classProperties' isn't currently enabled (43:22):
41 |
42 | class Icon extends PureComponent {
> 43 | static propTypes = {
| ^
44 | allowFontScaling: PropTypes.bool,
45 | name: IconNamePropType,
46 | size: PropTypes.number,
I also change my babel.config.js
to this:
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
[
'@babel/plugin-proposal-class-properties',
{
loose: true,
},
],
],
};
but still have the issue.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Error when adding react-native-web to an existing ... - GitHub
I created a react-native app, by doing react-native init ReactNativeWeb . Then, I followed the instructions here, to add react-native-web to it.
Read more >Error when adding react native web to react native project
I just created react native project and I want to add react native web to it. I follow document provided for it but...
Read more >Troubleshooting - React Native
If you added React Native manually to your project, make sure you have included all the relevant dependencies that you are using, ...
Read more >Addressing common errors in React Native - LogRocket Blog
Another error that developers commonly encounter when attempting to run their React Native application is shown below: Unable to load script.
Read more >How to add React Native Web to an existing ... - Aryan Goharzad
Initialize with Expo or use expo-cli. If you've initialized your project with Expo, it already comes with React Native for Web pre-configured.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I finally found solution. check here. https://stackoverflow.com/questions/62237236/error-while-adding-react-native-vector-icons-to-react-native-with-react-native-w
@Hamidrezana Hey Hamid, I added the
webpack.config.js
. The script in package.json runs using"web": "react-scripts start"
, I used the same tutorial. How can I configure it to use my custom webpack config, I’m stuck on the same error. Can you expand on your setup a bit more, would be really helpful, thanks.