react router v6 에서 path variable parameter 처리 샘플 코드

By | 10월 31, 2022

route

<Route
    path="invoices/:invoiceId"
    element={<Invoice />}
/>


page

function Invoice() {
  const { invoiceId } = useParams();
  const invoice = fetchBlaBla(`/api/invoices/${invoiceId}`);
  ...
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments