When I am trying to use react-native-vector-icon
with a React Project build with react-native-web
, I am getting
Support for the experimental syntax 'classProperties' isn't currently enabled
I have tried the following solution but none of those working for me.
- Support for the experimental syntax 'classProperties' isn't currently enabled
- Babel Plugin Class Properties – React Arrow Functions
- "loose": true is not fixing Support for the experimental syntax 'classProperties' isn't currently enabled
My package.json
{
"name": "react-webiste",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.19.2",
"fsevents": "^2.1.2",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-native": "^0.62.1",
"react-native-svg": "^12.1.0",
"react-native-vector-icons": "^6.6.0",
"react-native-web": "^0.12.2",
"react-router-dom": "^5.1.2",
"react-scripts": "3.0.0",
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@babel/plugin-proposal-class-properties": "^7.8.3"
}
}
babel.config.js
module.exports = {
presets: ["@babel/preset-env", "@babel/preset-react"],
plugins: ["@babel/plugin-proposal-class-properties",{"loose": true}]
};
Can anyone please suggest me what should I do to fix this issue.