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
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
Components do not rerun in Solid. Thus early returns would not work either.
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)
Are you doing
return doRender()
in a component? Maybe try wrapping it in a fragment/div to see if that worksyes thats what I'm doing
Ill try wrapping it in a fragment
Hooray wrapping it in a fragment worked 🙂
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 signalThank you!