Checking if children exists breaks refs
This has been driving me insane, but I just figured out that if you do something like this : https://playground.solidjs.com/anonymous/67fefe74-34a1-48a0-8d2c-b05d3ceb7abd , then the ref you end up with isn't actually in the dom, since the ref was assigned twice, once for the actual node in the dom, and once for the
props.children && "some-class-name"
thing.
1) Is this a bug?
2) Is there a general pattern I should use to avoid this?Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
2 Replies
I really gotta read docs more https://www.solidjs.com/docs/latest/api#children
That being said, this was surprising and took me hours to figure out, would be great to have some sort of warning for this if possible
Calling children in a memo would also help