PageNotFoundPage 组件
使用
要将 PageNotFoundPage 组件集成到应用中,请确保它已包含在路由配置中
-
导入组件
import PageNotFoundPage from './path/to/PageNotFoundPage';
-
在路由设置中为该组件添加路由。通常使用捕获所有路由(catch‑all route)来实现。
import { Routes, Route } from 'react-router-dom';
<Routes>
// ... All your other routes MUST be before this one
<Route path="*" element={<PageNotFoundPage />} />
</Routes>