javascript - 模块 '"./node_modules/react-native"' 没有导出的成员 'View'
问题描述
在我用打字稿转换我的项目后,显示我遵循错误 模块'“./node_modules/react-native”'没有导出成员'视图'。
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
- 关闭编辑器并重新启动一切。
推荐阅读
- angularjs - 无法使用AngularJS在Chrome以外的任何浏览器中下载变量到文件
- javascript - Javascript 将欧元符号转义为 %u2AC 而不是 %u20AC
- server-sent-events - 服务器使用 Spring WebFlux 和 EventSource 发送事件
- ios - 如何在 UIImageView 中实现底部自定义曲线和顶部角半径?
- android - 从对话框更新 RecyclerView
- javascript - 尝试使用清晰的 Node.js 调整流图像的大小
- javascript - 有没有办法在 Postman 中只使用一个请求,使用两个 API?
- python - pyside 按键事件无效
- swift - Swift - 内容视图的大小与 UITableViewCell 不匹配
- python - Keras后端自定义损失函数的理解列表