PageNotFoundPage 组件
用法
要将 PageNotFoundPage
组件集成到您的应用程序中,请确保它是您路由配置的一部分
-
导入组件
import PageNotFoundPage from './path/to/PageNotFoundPage';
-
在您的路由器设置中为组件添加一个路由。这通常使用通配符路由来完成
import { Routes, Route } from 'react-router-dom';
<Routes>
// ... All your other routes MUST be before this one
<Route path="*" element={<PageNotFoundPage />} />
</Routes>