我正在学习Reaction Native,这是一个错误,当我在iPhone上使用EXPO Go时试图设置整个程序.
当我运行npm start
或expo-cli start --tunnel
来启动Metro Bundler时,收到了这个错误.当我扫描它并打开EXPO GO时,我在我的VS代码上收到以下错误
ERROR Error: Text strings must be rendered within a <Text> component.
这个错误在iOS上的Expo Go上显示:
到目前为止,我唯一的代码(因为这只是在开始编码整个应用程序之前设置Expo和Metro Bundler):
import { View, Text } from 'react-native-web';
const Home = () => {
return (
<View>
<Text>HELLO</Text>
</View>
)
}
export default Home;
在index.js中
和
import { Stack } from 'expo-router';
const Layout = () => {
return <Stack/>;
}
export default Layout;
In_layout.js
但当我在浏览器上打开它,它出现了正确的代码.
如何解决这个问题(尤其是手机上显示的错误)?
For further reference, I am following the video here 和 I am stuck at minute 21:00 because of this Render Error.