gpt4 book ai didi

javascript - create-react-app/react-native-elements 错误

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:09:07 25 4
gpt4 key购买 nike

使用 create-react-app 启动了一个项目。安装了 react-native:“^0.57.8”,react-native-elements:“^0.19.1”和 react-native-vector-icons:“^6.1.0”。能够在项目中的 react-native-elements 中使用组件。

当我运行 npm start 时,我得到下面粘贴的错误代码。我已经通读了 react-native-elements 文档,但似乎找不到任何可以帮助我的东西

./node_modules/react-native-elements/src/avatar/Avatar.js
SyntaxError: D:\Location-Map\Neighborhood-Map-2-\location-
app\node_modules\react-native-elements\src\avatar\Avatar.js: Unexpected
token (92:8)

90 |
91 | return (
> 92 | <TouchableHighlight
| ^
93 | style={[
94 | styles.editButton,
95 | editButtonSizeStyle,

最佳答案

你不能那样做(如果你想知道为什么,请阅读 here)。你想构建一个网络应用程序吗?将 React 与 create-react-app 结合使用。你想构建一个移动应用程序吗?将 React Native 与 Expo 或 react-native init 结合使用。

我建议你看看material-ui作为 React 的组件库。

关于javascript - create-react-app/react-native-elements 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54190588/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com