0
        <Route
          path={CONFIRM_DELETE_INSTITUTE}
          handle={({
            match: {
              params: { instituteIndex },
            },
          }) => <ConnectedInstituteConfirmDelete instituteIndex={Number(instituteIndex)} />}
        />

I'm using react-router-dom v5 and now I want to migrate it to v6 . How I can convert this code to v6.

Shamaz saeed
  • 387
  • 3
  • 8
  • Can you explain the above code, what it does and how it's used? It doesn't look like RRDv5 code, so it's unclear what you might be trying to do in RRDv6. – Drew Reese Jan 04 '23 at 16:40
  • @DrewReese Like I'm passing institute index to the ConnectedInstituteConfirmDelete component and it takes institute index from the params in the url. – Shamaz saeed Jan 04 '23 at 17:13
  • 1
    So `instituteIndex` is a route path parameter? Why not access it via the normal means, i.e. the `useParams` hook? Does this [answer](/a/71003096/8690857) help? – Drew Reese Jan 04 '23 at 17:17

0 Answers0