react router v6 doesn’t support exact anymore.
// old – v5
<Route exact path="/" component={Home} />
// new – v6
<Route path="/" element={<Home />} />
As stated in their documentation:
You don’t need to use an exact prop on
<Route path="/">anymore.
This is because all paths match exactly by default. If you
want to match more of the URL because you have child routes use a trailing * as
in<Route path="users/*">.
You can refer to this migration guide: https://reactrouter.com/en/main/upgrading/v5