Pridgey
Pridgey
SSolidJS
Created by Pridgey on 2/21/2025 in #support
Another `template2 is not a function` issue
Can confirm this fixes things. Thank you very much for the help and also for the context around it!
5 replies
SSolidJS
Created by Pridgey on 2/21/2025 in #support
Another `template2 is not a function` issue
Oh interesting, I'll give that a try.
5 replies
SSolidJS
Created by Pridgey on 1/22/2023 in #support
Using FLIP Move with createServerData
That's a good insight. Thank you very much
7 replies
SSolidJS
Created by Pridgey on 1/22/2023 in #support
Using FLIP Move with createServerData
Adding and Removing items follows the same render flow. Those get animated. So I guess it seems to be recreating the TransitionGroup on rearrangement of the array?
7 replies
SSolidJS
Created by Pridgey on 1/15/2023 in #support
Subscribe to data in solid-start
oh interesting. I'll look into that. Thank you very much for the insight
8 replies
SSolidJS
Created by Pridgey on 12/14/2022 in #support
How to make a global layout?
Thank you very much
5 replies
SSolidJS
Created by Pridgey on 12/14/2022 in #support
How to make a global layout?
Yup, that did it
5 replies
SSolidJS
Created by Pridgey on 12/14/2022 in #support
How to make a global layout?
So routes/(root).tsx and routes/(root)/index.tsx like that?
5 replies
SSolidJS
Created by Pridgey on 12/8/2022 in #support
Getting User Info from route page
Nope
28 replies
SSolidJS
Created by Pridgey on 12/8/2022 in #support
Getting User Info from route page
Thank you for this
28 replies
SSolidJS
Created by Pridgey on 12/8/2022 in #support
Getting User Info from route page
Weird, I'll keep looking into what's weird about my instance.
28 replies
SSolidJS
Created by Pridgey on 12/8/2022 in #support
Getting User Info from route page
Can I see it please?
28 replies
SSolidJS
Created by Pridgey on 12/8/2022 in #support
Getting User Info from route page
oh?
28 replies
SSolidJS
Created by Pridgey on 12/8/2022 in #support
Getting User Info from route page
I'd probably see that in logs somewhere, right?
28 replies
SSolidJS
Created by Pridgey on 12/8/2022 in #support
Getting User Info from route page
Yeah that's where I'm at. Was just wondering if I was missing something silly like button onclick's don't work on SSR pages or something
28 replies
SSolidJS
Created by Pridgey on 12/8/2022 in #support
Getting User Info from route page
If I extract the <Form> component from createServerData$, and wrap my button in that, it works. Just feels like a pattern I'm not used to yet, I guess.
28 replies
SSolidJS
Created by Pridgey on 12/8/2022 in #support
Getting User Info from route page
Basically nothing happens
28 replies
SSolidJS
Created by Pridgey on 12/8/2022 in #support
Getting User Info from route page
console.log doesn't show in browser or in console, and none of the logs show up during the signout function, so fairly certain it's never getting there.
28 replies
SSolidJS
Created by Pridgey on 12/8/2022 in #support
Getting User Info from route page
Is there something I need to do to get buttons working on a page?
28 replies
SSolidJS
Created by Pridgey on 12/8/2022 in #support
Getting User Info from route page
So this is working great, I'm getting user info now:
// src/routes/index.tsx
import { Component } from "solid-js";
import { createServerData$, createServerAction$ } from "solid-start/server";
import { getUser, logout } from "~/lib/session";

export const retrieveUser = () =>
createServerData$(async (_, { request }) => {
const user = await getUser(request);
return user;
});

const Home: Component = () => {
const user = retrieveUser();
const [, signout] = createServerAction$((_, { request }) => logout(request));

return (
<div class="mt-20 w-full max-w-lg mx-auto">
<h1>Hello {user()?.user?.email || "World"}</h1>
<button
onClick={async () => {
console.log("test");
await signout();
}}
>
Logout
</button>
<pre>{JSON.stringify(user() ?? {}, null, 4)}</pre>
</div>
);
};

export default Home;
// src/routes/index.tsx
import { Component } from "solid-js";
import { createServerData$, createServerAction$ } from "solid-start/server";
import { getUser, logout } from "~/lib/session";

export const retrieveUser = () =>
createServerData$(async (_, { request }) => {
const user = await getUser(request);
return user;
});

const Home: Component = () => {
const user = retrieveUser();
const [, signout] = createServerAction$((_, { request }) => logout(request));

return (
<div class="mt-20 w-full max-w-lg mx-auto">
<h1>Hello {user()?.user?.email || "World"}</h1>
<button
onClick={async () => {
console.log("test");
await signout();
}}
>
Logout
</button>
<pre>{JSON.stringify(user() ?? {}, null, 4)}</pre>
</div>
);
};

export default Home;
But the button isn't firing when I click it.
28 replies