Saaa
Saaa
SSolidJS
Created by Saaa on 6/7/2024 in #support
Create Effect not executing
export default function Myperson() {
const [name] = createResource(() =>
db.selectFrom('person').selectAll().where("id" , "=" , 1).execute()
)
return (
<div>
<Suspense fallback="loading...">
{name()}
</Suspense>
</div>
);
}
export default function Myperson() {
const [name] = createResource(() =>
db.selectFrom('person').selectAll().where("id" , "=" , 1).execute()
)
return (
<div>
<Suspense fallback="loading...">
{name()}
</Suspense>
</div>
);
}
16 replies
SSolidJS
Created by Saaa on 6/7/2024 in #support
Create Effect not executing
I tried the following code (with id value 1 to test) but page /myperson shows loading then undefined (even without suspense it doesnt work)
16 replies
SSolidJS
Created by Saaa on 6/7/2024 in #support
Create Effect not executing
it worked this way but I'm pretty sure that this is a low quality code I hope someone would fix it
const [name , setName] = createSignal('Loading...')

async function getName(id: number) {
const x = await db.selectFrom('person').selectAll().where("id" , "=" , id).execute();
await console.log(x[0].first_name)
await setName(x[0].first_name);
}

export default function Myperson() {
getName(1);
return (
<div>
{name()}
</div>
);
}
const [name , setName] = createSignal('Loading...')

async function getName(id: number) {
const x = await db.selectFrom('person').selectAll().where("id" , "=" , id).execute();
await console.log(x[0].first_name)
await setName(x[0].first_name);
}

export default function Myperson() {
getName(1);
return (
<div>
{name()}
</div>
);
}
16 replies
SSolidJS
Created by Saaa on 6/7/2024 in #support
Create Effect not executing
(the function is working and logging Jhon this time)
16 replies
SSolidJS
Created by Saaa on 6/7/2024 in #support
Create Effect not executing
it shows undefined
16 replies
SSolidJS
Created by Saaa on 6/7/2024 in #support
Create Effect not executing
export default function Myperson() {
const [name , setName] = createSignal('Loading...')
setName(getName(1))

return (
<div>
{name()}
</div>
);
}
export default function Myperson() {
const [name , setName] = createSignal('Loading...')
setName(getName(1))

return (
<div>
{name()}
</div>
);
}
16 replies
SSolidJS
Created by Saaa on 6/7/2024 in #support
Create Effect not executing
i changed the Myperson function like this and it still didnt work how should i modify the function in order for it to work ?
16 replies
SSolidJS
Created by Saaa on 6/5/2024 in #support
How to get and set simple data or a variable in a session?
Thanks, so what should I use for sessions on the client side?
4 replies
SSolidJS
Created by Saaa on 5/30/2024 in #support
Cannot read properties of null (reading 'nextSibling') ERROR in a hello world simple Solidstart web
it works only if i slap in the bottom of the page <div> </div>
2 replies