Reputation: 15700
I am using React Router 6 with typescript and index
prop for <Route>
is not taking true or boolean values
<Routes>
<Route index>
<h1>Here</h1>
</Route>
</Routes>
It shows the following error
Upvotes: 1
Views: 469
Reputation: 15700
To use index
prop, you need to satisfy this
Should not have path
prop
Should not have children but only an element
prop
<Route index element={<h1>Here</h1>}/>
Upvotes: 1