SolidJSS
SolidJSโ€ข3y agoโ€ข
1 reply
Ostof

Set Initial Route using @solidjs/router

Hello,
I have a simple Router setup with 3 routes/tabs inside my Main component
<Routes>
  <Route path={'/1'} component={Tab1}></Route>
  <Route path={'/2'} component={Tab2}></Route>
  <Route path={'/3'} component={Tab3}></Route>
</Routes>

I want to make sure that every time the page is reloaded users are navigated to /1.
Currently I just call navigate('/1') using the useNavigate from the Router package inside the Main component and just wanted to know if there is another/better way to do this.
Was this page helpful?