How to pass key into createRouteData function inside useRouteData ?
Is this even possible ? I can't understand the docs
5 Replies
https://start.solidjs.com/api/createRouteData#fetching-data-with-a-key
Probably take a look at the docs again
aren't these params just the url params ? I will try anyway
Replied this in the general channel
As far as I know you can't pass custom keys or signals unless they are top level/ global variables to any routeData function other that the route parameters
some/path/[id]
and useLocation()
but I could be wrongyeah, that kinda sucks but okay, I can rearchitect around this
thanks for the clarification
No problem. The way I do it is to just use
createResource
and use the signal
as my argument which will fire once the signal is updated
And you can have the signal be updated in the onMount
function. So it's essentially working the same just done manually plus more control