The code below is responsible for building the sidebar on the site. In this case, the sidebar is 2 filter options, made in the form of a drop-down list.
This side bar is located on all pages of the site. However, the problem is that when switching between pages, the selected filter options are not saved. That is, if on the first page, the user checks something in the filters, then when going to the second page, the values in the filters will not be saved. And I would like the selected parameters for filtering to be saved when moving from page to page.
export default function App() {
return (
<ThemeProvider theme={theme} style="width: 100vw; height: 100vh">
<Header/>
<BrowserRouter>
<Routes>
<Route exact path='/test' element={<Test filterKey='device'/>}/>
<Route exact path='/devices' element={<DeviceList/>}/>
<Route exact path='/devices/:deviceId' element={<DeviceId/>}/>
<Route exact path='/devices/:deviceId/:userId' element={<UserId/>}/>
<Route exact path='/devices/:deviceId/:userId/:sessionId' element={<SessionId/>}/>
<Route exact path='/devices/:deviceId/:userId/:sessionId/:pocketId' element={<PocketId/>}/>
<Route path="*" element={<Navigate to="/devices" replace />}/>
</Routes>
<Footer/>
</BrowserRouter>
</ThemeProvider>
);
}