gpt4 book ai didi

javascript - 模块 '"./node_modules/react-native "' has no exported member ' 查看'

转载 作者:行者123 更新时间:2023-12-04 14:39:27 24 4
gpt4 key购买 nike

在我用 typescript 转换我的项目后,显示我出现以下错误
模块 '"./node_modules/react-native"' 没有导出的成员 'View'。

import React from 'react';
import {StyleSheet,View,Text} from 'react-native';

export default function App() {
return (
<View style={{ flex: 1 }}>
<Text>Welcome</Text>
</View>
);
}

最佳答案

  • 删除您的node_modules文件夹
  • 在终端上运行 npm install @types/react @types/react-native
  • 关闭编辑器并重新启动一切。
  • 关于javascript - 模块 '"./node_modules/react-native "' has no exported member ' 查看',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65914307/

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