here is my code
<Routes>
<Route path='/' element={<User/>} />
<Route path='/:userId/places' exact element={<UserPlaces/>} />
<Route path='/places/new' element={<NewPage/>}/>
<Route path='/places/:placeId' element={<UpdatePlace/>}></Route>
</Routes>
I want to redirect to the homepage if anything other than these URLs is entered, but using the redirect method in the latest version is not supported.