Answer the question
In order to leave comments, you need to log in
How to make a redirect from a parent component to a child?
react-router-dom 6.2.1
There is such a route with two children:
<Route path="/companies/:company/:meeting" element={ <Meeting /> }>
<Route path="resolutions" element={ <Resolutions /> } />
<Route path="participants" element={ <Participants /> } />
</Route>
<>
<Tabs routes={ tabsRoutes } />
<Outlet />
</>
Answer the question
In order to leave comments, you need to log in
Understood. Inside the parent (in my case - Meeting) you need to use
const navigate = useNavigate()
useEffect(() => {
navigate('./resolutions', { replace: true })
}, [])
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question