porting over some ssr react code, getting different behavior
this nextjs code
produces this
6 Replies
then i've got this code with solidstart
which produces
wondering what's causing the differences and how i can solve it
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 solidoh, looks like that did it
good to know, thanks!
👍