Outlet
interface OutletProps {
context?: unknown;
}
declare function Outlet(
props: OutletProps
): React.ReactElement | null;
const router = createBrowserRouter([
{
path: '/',
element: <App/>,
children: [
{
index: true,
element: <HomeComponent/>
},
{
path: '/about',
element: <About/>
},
]
}
])
export const HomeComponent = () => {
return (
<div>
<h1>welcome to home</h1>
<Outlet />
</div>
);
};最后更新于