SeanAye
SeanAye
SSolidJS
Created by SeanAye on 12/1/2023 in #support
show is rendering children when still falsy
I have a simple parent component in a CSR setup
const [data] = createResource(params, async ({ id }) => {
const out: AlreadyExistingForm = await invoke("get_config", {
id: Number(id),
});
return out;
});

return (
<Layout>
<Show when={data()}>
<EditS3ConfigForm initialForm={data()} />
</Show>
</Layout>
);
const [data] = createResource(params, async ({ id }) => {
const out: AlreadyExistingForm = await invoke("get_config", {
id: Number(id),
});
return out;
});

return (
<Layout>
<Show when={data()}>
<EditS3ConfigForm initialForm={data()} />
</Show>
</Layout>
);
When reading the props in the child component though, the props are undefined
export function EditS3ConfigForm(props: {
initialForm?: AlreadyExistingForm;
}) {
console.log(props)
const [form, setForm] = createStore(props.initialForm ?? defaultState);
export function EditS3ConfigForm(props: {
initialForm?: AlreadyExistingForm;
}) {
console.log(props)
const [form, setForm] = createStore(props.initialForm ?? defaultState);
This logs out an empty object. I understand the value im passing as a prop is not a signal but I dont think that should matter because the value should exist when initially rendering the child component
59 replies