Nathan
Nathan
SSolidJS
Created by Nathan on 8/11/2024 in #support
Hydration problem in Solid Start
const TransactionView: Component<RouteSectionProps> = () => {
const envelopesQuery = createQuery(() => ({
queryKey: ["transactions", "envelopes"],
queryFn: async () => await getEnvelopes(),
}))

const createTransactionMutation = createMutation(() => ({
mutationFn: createTransaction,
}))

return (
<ErrorBoundary fallback={<div>"Error!"</div>}>
<table class="w-full table-fixed">
<thead>
<tr>
<th class="w-1/6">Date</th>
<th class="w-1/6">Amount</th>
<th class="w-1/6">Description</th>
<th class="w-1/6">Payee</th>
<th class="w-1/6">Envelope Name</th>
<th class="w-1/6">Bank Account Name</th>
</tr>
</thead>
<tbody>

<tr>
<Suspense fallback={<div>Loading form...</div>}>
<TransactionForm
onSubmit={(values) => createTransactionMutation.mutate(values)}
envelopes={envelopesQuery.data || []}
/>
</Suspense>
</tr>
</tbody>
</table>
</ErrorBoundary>
)
}
const TransactionView: Component<RouteSectionProps> = () => {
const envelopesQuery = createQuery(() => ({
queryKey: ["transactions", "envelopes"],
queryFn: async () => await getEnvelopes(),
}))

const createTransactionMutation = createMutation(() => ({
mutationFn: createTransaction,
}))

return (
<ErrorBoundary fallback={<div>"Error!"</div>}>
<table class="w-full table-fixed">
<thead>
<tr>
<th class="w-1/6">Date</th>
<th class="w-1/6">Amount</th>
<th class="w-1/6">Description</th>
<th class="w-1/6">Payee</th>
<th class="w-1/6">Envelope Name</th>
<th class="w-1/6">Bank Account Name</th>
</tr>
</thead>
<tbody>

<tr>
<Suspense fallback={<div>Loading form...</div>}>
<TransactionForm
onSubmit={(values) => createTransactionMutation.mutate(values)}
envelopes={envelopesQuery.data || []}
/>
</Suspense>
</tr>
</tbody>
</table>
</ErrorBoundary>
)
}
3 replies
SSolidJS
Created by Nathan on 2/23/2024 in #support
Solid-Start preloads 404 page instead of OAuth API route
I'm just using an a tag to navigate.
9 replies
SSolidJS
Created by Nathan on 2/23/2024 in #support
Solid-Start preloads 404 page instead of OAuth API route
I'm using Lucia.
9 replies
SSolidJS
Created by Nathan on 12/26/2023 in #support
Accessing grandchildren
That might work if I know how many slots are needed ahead of time.
7 replies
SSolidJS
Created by Nathan on 12/26/2023 in #support
Accessing grandchildren
I'm using the Solid JS Swiper component to render a slideshow. What I'd like to do is use Astro's <Image> component to handle optimization of the images, and then pass those components as children to be placed within individual slides in Swiper. However, the behavior I'm getting is that all children images are rendered into a single slide, rather defeating the purpose.
7 replies
SSolidJS
Created by AesthetiCoder on 10/24/2023 in #support
Signal dont update the class
In general, you want to avoid destructing props. So instead of destructuring with
const Component = ({foo, bar}) => ...
const Component = ({foo, bar}) => ...
simply use
const Component = (props) =>
const Component = (props) =>
and then use props.foo and props.bar.
10 replies
SSolidJS
Created by AesthetiCoder on 10/24/2023 in #support
Signal dont update the class
import { splitProps, type ParentComponent } from "solid-js"

interface Props {...}

const Button: ParentComponent<Props> = (props) => {
const [local, rest] = splitProps(props, ["customClass", "onClick", "children"])

return (
<button
onclick={local.onclick}
class={local.custonClass}
{...rest}
>
{local.children}
</button>
);
};

export { Button }
import { splitProps, type ParentComponent } from "solid-js"

interface Props {...}

const Button: ParentComponent<Props> = (props) => {
const [local, rest] = splitProps(props, ["customClass", "onClick", "children"])

return (
<button
onclick={local.onclick}
class={local.custonClass}
{...rest}
>
{local.children}
</button>
);
};

export { Button }
10 replies
SSolidJS
Created by AesthetiCoder on 10/24/2023 in #support
Signal dont update the class
You're destructuring props in the Button component. This breaks reactivity. Instead, you can use splitProps:
10 replies
SSolidJS
Created by Nathan on 10/21/2023 in #support
`ReferenceError: Request is not Defined` on Node 18
If I remove adapter: netlify() from vite.config.ts, then the problem goes away.
2 replies
SSolidJS
Created by Nathan on 9/24/2023 in #support
"Make sure your app is wrapped in a `<Router>`" with Lucia-Auth
Oh, I just needed this to be routeData = () => createServerData$....
2 replies
SSolidJS
Created by Alexis Graff on 8/20/2023 in #support
<Show when={}> typescript error question.
I think that's a bug in IntelliJ's engine, then.
8 replies
SSolidJS
Created by Alexis Graff on 8/20/2023 in #support
<Show when={}> typescript error question.
The same code works fine in my setup.
8 replies
SSolidJS
Created by Alexis Graff on 8/20/2023 in #support
<Show when={}> typescript error question.
Hmm, I was hoping to see something wrong there, but nothing sticks out :/
8 replies
SSolidJS
Created by zh0nb on 8/20/2023 in #support
Array of components gets re-render every time that a new component is added
You also might try using For instead of Index. Though thh I don't really grok the difference between the two.
10 replies
SSolidJS
Created by zh0nb on 8/20/2023 in #support
Array of components gets re-render every time that a new component is added
10 replies
SSolidJS
Created by zh0nb on 8/20/2023 in #support
Array of components gets re-render every time that a new component is added
reference is a signal and index is fixed. With For, it's the other way around.
10 replies
SSolidJS
Created by zh0nb on 8/20/2023 in #support
Array of components gets re-render every time that a new component is added
I'm not sure this is the problem, but the item in Index is a signal, so I think that the <>{reference}<> in your Index child should be <>{reference()}<>.
10 replies
SSolidJS
Created by Alexis Graff on 8/20/2023 in #support
<Show when={}> typescript error question.
You could add a type annotation so it's createSignal<boolean>(false), but you shouldn't have to.
8 replies
SSolidJS
Created by Alexis Graff on 8/20/2023 in #support
<Show when={}> typescript error question.
Can you post your tsconfig.json?
8 replies
SSolidJS
Created by Nathan on 8/19/2023 in #support
Kobalte popover not opening in testing
Yes, that's just the individual test
6 replies