foolswisdom
tree structure: granular updates and retain open state
Also, probably not related to your problem, but using if/else branching in js (rather than in jsx) means that you won't see updates unless the function callback runs again (which is not how it is meant to work by design)
8 replies
tree structure: granular updates and retain open state
A potential problem is that For operates using reference equality, but object.entries will produce a new array of (new) key/value pairs (as two element arrays), so you won't keep reference equality
8 replies
porting over some ssr react code, getting different behavior
Try
Your current code is checking the truthiness of the isFormControl variable, not the truthiness of the result of the function.
BTW (this doesn't quite matter in your code, but) although it looks like passing
isFormControl()
is passing a static value rather than a reactive value, solid's jsx transform wraps and lazifies the call (this is true only in jsx), so when the Show component internally accesses props.when
it's actually calling the function (which subscribes to the value of Foo). This is how you normally pass props to components in solid8 replies