Fabian Hiller
Explore posts from serversIs it possible to create a `createCustomAction$`?
@nksaraf is it technically possible to create a custom
createCustomAction$
function that builds on createServerAction$
or server$
? This would allow library authors to keep the API simple, making the code more concise.
Specifically, I would like to provide a SolidStart integration for my form library Modular Forms to enable the creation of progressively enhanced forms. Below is a code example.
10 replies
How to set a cookie when using `createRouteData` or `createServerData$`?
For user authentication it may be necessary to set a cookie. In Remix, for example, it is solved so that a
loader
can either directly return a value or alternatively a Response
. The Response
can then be used to set the Set-Cookie
header. Remix seems to recognize whether the values are returned directly or via a Response
, e.g. with json({...})
, and interprets the types correctly when calling useLoaderData<typeof loader>()
. This does not seem to work with SolidStart. Is there an alternative way? https://remix.run/docs/en/v1/route/loader14 replies
Refetch routeData when dynamic route changes
I use a dynamic route
[slug].tsx
to display a blogpost for example. To get the data of the post from the database I use routeData
in combination with createRouteData
. Thereby I set the slug
as the key
. If I now navigate with a link between blogposts, routeData
or createRouteData
is not executed again, so the content of the dynamic route does not change. Is this intended or a bug? Do I need to use refetchRouteData
to trigger this myself e.g. in createEffect
?
2 replies