Replies: 1 comment 4 replies
-
That's roughly the case I'm working on right now. If the goal is to store the state of all open tabs and share the link with someone, so that another person can get the same state as you by pasting the link into their browser, then the most reliable way is to store everything in URL parameters, for example: It should be taken into account that any updating of parameters in the URL by means of the library will lead to page re-rendering, which is not always the desired behavior. I solved it the way I described in my comment here |
Beta Was this translation helpful? Give feedback.
-
im working on a React application that features a dynamic side navigation bar, the key functionality im aiming for involves the ability to open multiple tabs within the application when specific links in the sidebar navigation are clicked, each link click not only takes the user to a new page but also dynamically creates a new tab within the app
once these tabs are opened, the user should be able to seamlessly switch between them, and the state of each tab should be preserved, this means that if a user interacts with the content in one tab and then switches to another, the state of the first tab should be maintained, also i plan to heavily rely on storing the tab's query params and filter options in the URL ,this way, when a user shares a link with someone else the recipient can see exactly what the sender is seeing, including the specific tab configuration and content
im interested in recommendations and best practices for implementing this dynamic tab behavior within a React application, especially regarding React Router and state management, thank you for your help!
Beta Was this translation helpful? Give feedback.
All reactions