You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug?]: reading JSX.Element prop outside JSX or > 1 time causes SSR hydration mismatch errors #1993
changed the title [-][Bug?]: reading JSX.Element prop > 1 time causes SSR hydration mismatch errors[/-][+][Bug?]: reading JSX.Element prop outside JSX or > 1 time causes SSR hydration mismatch errors[/+]on Oct 21, 2025
I don't find this behavior intuitive. In my mind, when i pass <div/> as props.children or props.left (e.g. <Header left={<div/>}), the div should be created immediately and only once. Subsequent access through props.left should merely return the created element, not recreate it every time.
However, even assuming this behavior is correct, I still don't believe it should result in hydration errors. The div being console.logged is not rendered in a template and is absent from the resulting HTML, so why is it being hydrated?
P.S. I would also expect the <Show /> component to handle cases like this out of the box without needing for utilities. Seems like a very common use case that results in a confusing error
Activity
[-][Bug?]: reading JSX.Element prop > 1 time causes SSR hydration mismatch errors[/-][+][Bug?]: reading JSX.Element prop outside JSX or > 1 time causes SSR hydration mismatch errors[/+]brenelz commentedon Oct 24, 2025
Is there a github repo i can use to replicate this?
brenelz commentedon Oct 24, 2025
I feel this is intended behavior. I think you have to use the
childrenhelper.https://docs.solidjs.com/reference/component-apis/children
illiaChaban commentedon Oct 24, 2025
@brenelz there's a stackblitz link you to project you can fork (top right corner): https://codesandbox.io/p/devbox/423f4v
I don't find this behavior intuitive. In my mind, when i pass
<div/>asprops.childrenorprops.left(e.g.<Header left={<div/>}), thedivshould be created immediately and only once. Subsequent access throughprops.leftshould merely return the created element, not recreate it every time.However, even assuming this behavior is correct, I still don't believe it should result in hydration errors. The
divbeingconsole.loggedis not rendered in a template and is absent from the resulting HTML, so why is it being hydrated?P.S. I would also expect the
<Show />component to handle cases like this out of the box without needing for utilities. Seems like a very common use case that results in a confusing errorbrenelz commentedon Jul 17, 2026
I think this is a solidjs issue and not solid start specifically