how do i wrap 2 routes in a context in react router v6? only these two should be exposed to that context and i cant set the context separately because the context runs some code(useEffect) and if i do that it triggers everytime i switch route, i want it to trigger before i load the 2 routes not after pressing them, but also after i load app.js so app.js loads and the context provider doesnt, then when i one of the 2 routes the context triggers, and when i switch between them it wont trigger is it possible? thanks
return (
<Layout>
<Routes>
<Route path="/*" element={<Navigate replace to='/login'/>} />
<Route path="/pracels" element={<PracelsPage/>} />
<Route path="/search" element={<SearchPracelPage/>} />
<Route path="/login" element={<LoginPage/>} />
</Routes>
</Layout>
);
i want to wrap /pracels and /search with 1 context provider