SolidJSS
SolidJSโ€ข3y agoโ€ข
27 replies
Mathieu

Solid Router and losing Contexts

When navigating to a route, I noticed I lose all the context values. I have to wrap the component (that needs to rendered for the route) again by all the context providers, and for every route.
Is this normal? It seems awkward. (of course I can create some generic component that wraps the component to render for that route with all the context providers again, but is it normal in the first place that I lose the contexts? If so, how do you approach this?)
<Route
  path={translate('uri_select_login_auth_method')}
  element={
    <BarContextProvider>
      <FooContextProvider>
        <Content><AuthenticationMethodSelector mode="login" /></Content>
      </FooContextProvider>
    </BarContextProvider>
  }
/>
Was this page helpful?