Component does not rerender when the state changes

I have attached the render logic in the attached file, the only relevant missing part is this from the top of the component
const [currentPopup, setPopup] = createSignal(null)
const [currentPopup, setPopup] = createSignal(null)
for some reason the console.log statement inside doRender is only called once and never after setPopup is called, even though I confirmed that the value is getting set inside the click listener. Please help ;.;
6 Replies
REEEEE
REEEEEโ€ข7mo ago
Components do not rerun in Solid. Thus early returns would not work either.
ษ”nีŠรพn1๐ŸŒšโ“’สž AKA Purpl
what can I do to make it so that it renders a popup instead of the main component content conditionally upon that signal changing? Also I thought it could "rerun" if it was wrapped in a closure (like im doing here)
REEEEE
REEEEEโ€ข7mo ago
Are you doing return doRender() in a component? Maybe try wrapping it in a fragment/div to see if that works
ษ”nีŠรพn1๐ŸŒšโ“’สž AKA Purpl
yes thats what I'm doing Ill try wrapping it in a fragment Hooray wrapping it in a fragment worked ๐Ÿ™‚
REEEEE
REEEEEโ€ข7mo ago
nice Yeah, you can do it your way but it has to be inside JSX, if you just do return doRender() it will only run once and won't react to changes to the signal