SolidJSS
SolidJSโ€ข3y agoโ€ข
2 replies
Grahf

Fetching data in root.jsx

I have solidStart connected to a local postgre database. I can fetch data from it in files in the "routes" folder using createServerData$ and useRouteData. But that doesn't work in root.jsx. I was hoping to populate a navbar with items from the database.

Maybe there is another way to show a component on every route(in this case the nav bar) that can also useRouteData? Or maybe I need to setup an API route to fetch data fro root.jsx?
Was this page helpful?