I'm getting a hydration mismatch error for this code, and I don't really understand why.
Hydration Mismatch. Unable to find DOM nodes for hydration key: 00000000100...
and indicating the child of this component
Here is a minimal code sample:
export function Button(props) {
const [specialProps, passedProps] = splitProps(props, [
"class",
"children",
"disabled",
"leftIcon",
]);
const buttonCva = cva("btn", {
variants: {
disabled: {
true: "btn-disabled",
},
},
});
return (
<button class={buttonCva(specialProps)} {...passedProps}>
{specialProps.leftIcon}
{specialProps.children}
</button>
);
}
What I figured out so far is that if I remove from "children"specialProps (so it will be in passedProps), it works.