9 Replies
I can get the data from function
routeData
to work in the componentA in file ComponentA.tsx
Which is great!
But
1) If I try to move export function routeData({ params }: RouteDataArgs<{id:string}>)
into it's own file the code will break.
2) If I change the name of routeData
to anything besides routeData the code will break.
Neither of which make sense to meexport { routeData }
Can you elaborate? I don't really understand
if you import route data from another file, it has to still be exported from the page file as routeData
SolidStart Beta Documentation
SolidStart Beta Documentation
Early release documentation and resources for SolidStart Beta
Gotcha. What I was trying to do was what i saw done in the Movies example:
https://github.com/solidjs/solid-start/tree/main/examples/movies
GitHub
solid-start/examples/movies at main · solidjs/solid-start
SolidStart, the Solid app framework. Contribute to solidjs/solid-start development by creating an account on GitHub.
The
useMovie(params: any)
function that contains createRouteData
is used in 3 other components files and does not seem to follow the same practice that is shown in the docs - from what I understand at leastcreateRouteData can be used anywhere so you should be good to wrap it. routeData can't
Got it. I understand now.
routeData
is a reserved word that works in accordance with useRouteData
. I didn't understand that from the documentation. I thought routeData was just random variable name and not something unique. I wonder if there's a way to express that better, or if I'm just an outlier and it's clear to everyone else.
In any case, thank you for taking the time to explain it