22 Replies
fetchBal()
is returning undefined and you cant access subscription
if it is undefined
do fetchBal() && Object.keys(fetchBal()!["subscription"]).length === 0
i'm using JSX ! doesn't work
plus it's returning data just before calling setter function
why wouldnt the
!
operator work on JSX? Works for me
Also, Show
needs a fallback
prop.
Since its basically a ternary under the hood.it doesn't need a fallback prop
it's optional
Okay, but the initial data will be undefined
every time ive used it without the fallback i get errors in the inspect tool
I've never run into that
weird
export const [fetchBal, setFetchBal] = createSignal();
logs returns 0 and true one after anotheryes, but when everything is evaluated,
Show
receives undefined first
okay you can probably remove the !
thenyeah, i was told by another user just now that its probably a bug in solid-start that i was experiencing, fallback is optional.
i'm using solid-js/web not solid-start
and you want to check if
fetchBal() !== undefined
fetchBal() === undefined, removes an error but as the object is just empty
{}
this acts super weird!==
not ===
we want to check if the data is available, then show the stuffyeah i was using reverse data as fallback
is this somewhat related to being the {} is empty?
umm maybe, is it not supposed to be empty?
i have to handle when there's no subscription
so in this case it's empty
You could use the Switch Match components
or change how you're doing it, reverse it so the fallback is when the data is unavailable
also what do you mean it acts super weird when the object is empty?
i just mean i'm not able to find solution yet
whoa it worked. thank you