React 找不到路由位置

问题描述 投票:0回答:1

我不知道为什么会发生这种情况,但它说没有与位置“/”匹配的路线。从头文件中可以看出,该 url 中有 home 组件。

为了更好地理解,这里是存储库: https://github.com/MohdZaid259/MegaBlog.git

javascript reactjs jsx
1个回答
0
投票

您是否尝试过在

index
中添加
<Route />
属性?

<Route index element={<Home />} />

https://github.com/remix-run/react-router/blob/dev/examples/basic/src/App.tsx#L19-L22

© www.soinside.com 2019 - 2024. All rights reserved.