Outlet

<Outlet>

渲染父路由对应的子路由。

¥Renders the matching child route of a parent route.

import { Outlet } from "@remix-run/react";

export default function SomeParent() {
  return (
    <div>
      <h1>Parent Content</h1>

      <Outlet />
    </div>
  );
}

属性

¥Props

context

为出口下方的元素树提供上下文值。当父路由需要向子路由提供值时使用。

¥Provides a context value to the element tree below the outlet. Use when the parent route needs to provide values to child routes.

<Outlet context={myContextValue} />

另请参阅:useOutletContext

¥See also: useOutletContext

Remix v2.17 中文网 - 粤ICP备13048890号