【发布时间】:2020-10-11 16:44:30
【问题描述】:
我有一个为 iOS、Android 构建的现有 React Native 项目,我可以使用 expo start 命令在 web 中运行,但我无法运行 expo build:web 并在本地运行它
npx serve web-build
空白页中的控制台显示:
ReferenceError: Platform is not defined
在我的代码中,我有以下内容:
<KeyboardAvoidingView
behavior={Platform.OS == "ios" ? "padding" : "height"}
style={styles.container}
>
如果我尝试通过 Git 连接将相同的代码部署到 Amplify,它会返回一个错误,例如
No such file ./components/myComponent.js
我不确定为什么它不能在任何一个 Web 部署上运行
任何帮助将不胜感激
【问题讨论】:
标签: reactjs react-native expo