英文:
How do I use Route path to go
问题
我尝试学习react navigation,使用路由和路由路径,但似乎我在某个地方犯了错误,有人能帮我吗?
我试图不断更改div和显示帖子的div,但现在它什么都不显示,它曾经显示帖子和按钮,但无法前进。
英文:
I'm trying to learn react navigation, using route and route path but I seem to be making mistake somewhere, can anyone help me with it?
I tried to keep changing the div and the div that shows the posts but it doesn't show anything now, it was showing the posts and the buttons but couldn't go to
答案1
得分: 1
需要将组件更改为element
<Routes>
<Route path="/profile" element={<Profile />} />
</Routes>
英文:
You need to change the Component to element
<Routes>
<Route path="/profile" element={<Profile/>} />
</Routes>
答案2
得分: 1
代替组件,你应该使用元素
<Routes>
<Route path="/profile" element={<Profile />} />
</Routes>
英文:
Instead of component you should use element
<Routes>
<Route path="/profile" element={<Profile/>} />
</Routes>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论