function Test() {
return <div>test</div>;
}
function Main() {
const a = Test();
return (
<>
</>
);
}
Why this can cause Error: Hydration Mismatch. Unable to find DOM nodes for hydration key: s00-0-0-0
EDIT:
The component constructed before return in the function body must be used in the return html. Otherwise, it will cause the Hydration Mismatch error.
This issue will disable the Show logic for the component.
Neither
<Show when={should_show()}>
{a}
</Show>
or
{should_show() ? a : undefined}
can be used. Both of them will cause the Hydration Mismatch error.