I’ve got a project using react-router v6.
I have this code :
<Route exact path="planning" element={<PageNotFound />}>
<Route path="individual" element={<IndividualPlanning />} />
<Route path="team" element={<TeamPlanning />} />
</Route>
Which is not working at all.
When I visit /planning/individual
I fallback on the PageNotFound
component. It is the same for /planning/team
.
Refering to this feed : Property 'exact' does not exist on type
Even when I don’t use exact it is the same behavior.
The only solution I have would be to use 2 different routes without childrens, but I’d rather not do this.
Any help would be appreciated, thank’s!
2
Answers
React Router v6, you should use the * wildcard instead of exact. Here’s the updated code:
can you try to write it like this?