目前没有在React.js上启用对实验语法'classProperties'的支持错误

问题描述 投票:1回答:1

[当我尝试将react-native-vector-icon与带有react-native-web的React Project构建一起使用时,我得到

目前尚不支持实验语法'classProperties'已启用

我尝试了以下解决方案,但没有一个适合我。

  1. Support for the experimental syntax 'classProperties' isn't currently enabled
  2. Babel Plugin Class Properties – React Arrow Functions
  3. "loose": true is not fixing Support for the experimental syntax 'classProperties' isn't currently enabled

我的[[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}] };
Error Screenshot Link

有人可以建议我如何解决此问题。

javascript reactjs react-native babel react-native-web
1个回答
1
投票
编辑:看来您的问题是图书馆所有者的当前问题。该库是为react-native构建的,在该库中,用户用于手动翻译。您可以找到the GitHub project issue here
© www.soinside.com 2019 - 2024. All rights reserved.