S
SolidJS4mo ago
Worble

Reactivity from a hook passed down to a component

Hi, I am trying to create a hook that returns a discriminated union which is then passed to a helper component to handle some common states, however while this works for the first render, it doesn't appear to update on changes. Repro URL: https://playground.solidjs.com/anonymous/7e285c43-b1d0-4a35-adda-35c0ba825294 You can click the button to retrigger the hook and return a new result. I can see from the createEffect's that the components are subscribed to changing value, but if you keep clicking the button the new value is not rendered on the page. If you uncomment line 20, the changing state does appear to cause it to update properly after that Thanks for any help!
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
2 Replies
REEEEE
REEEEE4mo ago
the value passed to children won't be reactive because it's been called already in FetcherWrapper. You should provide an accessor instead like props.children(() => success().result)
Worble
WorbleOP4mo ago
Ah I see, so if I just pass up the accessor from Match, the parent can use that, thanks!
Want results from more Discord servers?
Add your server