Hydration Mismatch with `solid-icons`
I have this component:
and I call it as:
where
<ImCross />
is a solid-icons
icon.
When I do that I see the icon for a split second and then I get:
Hydration Mismatch. Unable to find DOM nodes for hydration key: 0000000010000010000000600021200 <svg stroke-width="0"></svg>Am I doing something wrong?
5 Replies
The issue might be that you use
props.left
and props.right
twice each. You could create your own memo, or use the one from Show
:
@Erik Demaine Are there issues with using a prop twice in a component?
If the prop is a component, it causes that component to render twice
See https://docs.solidjs.com/reference/component-apis/children for relevant discussion for
props.children
, but the same applies for all props that take components I believe
I'm not super familiar with hydration debugging but I could imagine rendering twice might confuse the process@Erik Demaine That was it. Thanks 🫶
Yay!!