SolidJSS
SolidJSβ€’16mo agoβ€’
23 replies
exercise

is there a way to start data fetching before component rendering?

react router runs the loader before the component. thus making things like redirects easier. is there a way to do this with @solidjs/router?
export const routes = createRoutesFromElements(
  <>
    <Route
      loader={() => Response.redirect("/other")}
      path="/"
      element={<Home />}
    />
    <Route path="/other" element={<Other />} />
  </>
);
Was this page helpful?