Zack Pitcher
Zack Pitcher
SSolidJS
Created by Zack Pitcher on 12/8/2023 in #support
routeData params are empty but not useParams
Hmm interesting. I didn’t know it wasn’t a closure.
10 replies
SSolidJS
Created by Zack Pitcher on 12/8/2023 in #support
routeData params are empty but not useParams
thanks
10 replies
SSolidJS
Created by Zack Pitcher on 12/8/2023 in #support
routeData params are empty but not useParams
Got it working using a GET() API route + createResource
10 replies
SSolidJS
Created by Zack Pitcher on 12/8/2023 in #support
routeData params are empty but not useParams
Also, what's going on in this example from the docs? Isn't it using the params right there?
import { RouteDataArgs } from "solid-start";
import { createServerData$ } from "solid-start/server";

export function routeData({ params }: RouteDataArgs) {
return createServerData$(
([, id]) => prisma.students.findUnique({ where: { id } }),
{ key: () => ["students", params.id] }
);
}
import { RouteDataArgs } from "solid-start";
import { createServerData$ } from "solid-start/server";

export function routeData({ params }: RouteDataArgs) {
return createServerData$(
([, id]) => prisma.students.findUnique({ where: { id } }),
{ key: () => ["students", params.id] }
);
}
10 replies
SSolidJS
Created by Zack Pitcher on 12/8/2023 in #support
routeData params are empty but not useParams
what would be the solid way to do that?
10 replies
SSolidJS
Created by Zack Pitcher on 3/2/2023 in #support
Mutating element onMount doesn't re-render
As an update to this, it works when I save and HMR reloads the state. But it still doesn't work on a full refresh of the page. I've even tried doing a setTimeout() inside of onMount() to delay the execution until the Solid runtime has loaded, but that still didn't work
12 replies
SSolidJS
Created by Zack Pitcher on 3/2/2023 in #support
Mutating element onMount doesn't re-render
Wow that is bizarre. But this helps because it means I'm looking in the wrong place!
12 replies
SSolidJS
Created by Zack Pitcher on 3/2/2023 in #support
Mutating element onMount doesn't re-render
Thanks!
12 replies
SSolidJS
Created by Zack Pitcher on 3/2/2023 in #support
Mutating element onMount doesn't re-render
I see, thanks. Do you have any idea what could be causing this?
12 replies
SSolidJS
Created by Zack Pitcher on 3/2/2023 in #support
Mutating element onMount doesn't re-render
Is there a way to test SSR with the playground?
12 replies
SSolidJS
Created by Zack Pitcher on 3/2/2023 in #support
Mutating element onMount doesn't re-render
Interesting, when I return that from SSR it doesn't contain anything
12 replies
SSolidJS
Created by Zack Pitcher on 3/2/2023 in #support
Mutating element onMount doesn't re-render
Basically my question is, why didn't 1. or 2. work? And does Solid provide an alternative 3. (mutating the DOM using document.getElement... etc) that is less cumbersome?
12 replies