Describe the bug
The below pattern causes hydration mismatch:
const Icon: Component<any> = (props) => {
const rest = omit(props, "iconNode");
return (
<svg {...rest} stroke-width={props.cond ? props.x : 2}>
<For each={props.iconNode}>{([tag, attrs]) => <div />}</For>
</svg>
);
};
Hydration completed with 4 unclaimed server-rendered node(s):
<div _hk="2100"></div>
<div _hk="2110"></div>
<div _hk="2120"></div>
<div _hk="2130"></div>
For as a sibling also causes the issue:
const TextInput: Component<any> = (props) => {
return (
<>
<input {...props} data-test={props.cond ? props.x : 2} />
<For each={[1, 2]}>{() => <div />}</For>
</>
);
};
Your Example Website or App
https://stackblitz.com/edit/nitrojs-nitro-uqjyhazp?file=src%2Fapp.tsx
Steps to Reproduce the Bug or Issue
- Go to the link above
- See console logs
Expected behavior
No hydration issue
Screenshots or Videos
No response
Platform
- OS: [e.g. macOS, Windows, Linux]
- Browser: [e.g. Chrome, Safari, Firefox]
- Version: [e.g. 91.1]
Additional context
No response
Describe the bug
The below pattern causes hydration mismatch:
Foras a sibling also causes the issue:Your Example Website or App
https://stackblitz.com/edit/nitrojs-nitro-uqjyhazp?file=src%2Fapp.tsx
Steps to Reproduce the Bug or Issue
Expected behavior
No hydration issue
Screenshots or Videos
No response
Platform
Additional context
No response