Routing patterns

Context My app has a thing called spaces where you can access multiple tabs like "Tasks", "Journeys", etc. The route for a space is /spaces/:id. I am using headless UI tabs to show the different tabs in a space. As of now I do not have a route defined for each tab. I did not foresee the need to be able to go to a tab directly through navigation but I now need to. For example, I need to be able to go to a space and in the space to the journey tab (which is the second tab) directly from somewhere else. The default behavior is to render the first tab as the selected tab. I am using react router as of now (have not made a switch to Next as yet). Questions 1. Should I be creating the route as /spaces/:id/:tab and then look at the query param and set the tab accordingly? 2. In the journeys tab, clicking on a journey should take them to that journey which would need its own page. How should I be handling this routing? Should I create a spaces/:id/journeys/:journeyId route? Or should I create a /journeys/:journeyId route? What is recommended?
0 Replies
No replies yetBe the first to reply to this messageJoin