Routes

概要

Reference Documentation ↗

現在のロケーションに最も一致する <Route>s のブランチをレンダリングします。これらのルートは、データローディングaction、コード分割、またはその他のルートモジュールの機能には関与しないことに注意してください。

import { Route, Routes } from "react-router";
 
<Routes>
  <Route index element={<StepOne />} />
  <Route path="step-2" element={<StepTwo />} />
  <Route path="step-3" element={<StepThree />} />
</Routes>

シグネチャ

function Routes({
  children,
  location,
}: RoutesProps): React.ReactElement | null

Props

children

ネストされた Route 要素

location

マッチングに使用する Location。デフォルトは現在のロケーションです。