您如何修复未终止的JSX内容?
我一直在使用React-Native尝试创建一个简单的应用程序。但是,我对此非常陌生,我不知道自己在做什么。 这是我的代码:
import React from 'react'
import { View, Text, Button } from 'react-native'
import { useNavigation } from "@react-navigation/core";
const HomeScreen = () => {
const navigation= useNavigation();
return (
<View>
<Text>I am the home screen<Text/>
<Button title="Go to Chat Screen"
onPress={() => navigation.navigate("Chat")}
/>
</View>
)
}
export default HomeScreen
这是错误:
SyntaxError: C:\Users\Owner\CornellDatingRemix\screens\HomeScreen.js: Unterminated JSX contents. (13:15)
11 | onPress={() => navigation.navigate("Chat")}
12 | />
> 13 | </View>
| ^
14 | )
15 | }
16 | export default HomeScreen
如何解决此问题?
I have been using react-native to try and create just a simple app. However, I am very new to this and I have no clue what I am doing.
This is my code:
import React from 'react'
import { View, Text, Button } from 'react-native'
import { useNavigation } from "@react-navigation/core";
const HomeScreen = () => {
const navigation= useNavigation();
return (
<View>
<Text>I am the home screen<Text/>
<Button title="Go to Chat Screen"
onPress={() => navigation.navigate("Chat")}
/>
</View>
)
}
export default HomeScreen
Here is the error:
SyntaxError: C:\Users\Owner\CornellDatingRemix\screens\HomeScreen.js: Unterminated JSX contents. (13:15)
11 | onPress={() => navigation.navigate("Chat")}
12 | />
> 13 | </View>
| ^
14 | )
15 | }
16 | export default HomeScreen
How do I fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您只有一个错别字:
You just have a typo: