I'm using react-router v6, Is it possible to use nested routes without using the Outlet component?
For example: I have a users page and onClick on a user component it should navigate to the specific user page,
Current try:
<Routes>
<Route path="/" element={<Home />} />
<Route path="/users" element={<Users />} />
<Route path=":id" element={<UserPage/>} />
</Routes>
And on click on a specific user:
const gotoUserPage = () => {
navigate('1')
}
The gotoUserPage change the URL from '/users' to '/users/1' but the userPage component doesn't render.