The Wayback Machine - https://web.archive.org/web/20251220203659/https://github.com/facebook/react/issues/24567
Skip to content

Bug: Component returning string causes hydration mismatch #24567

@subhero24

Description

@subhero24

I have a component like this:

function Component() {
    let string = useSuspendingHook()

    return string
}

On the server I render the component with renderToPipeableStream. When hydrating the component I get a Hydration failed because the initial UI does not match what was rendered on the server..

What makes me think this is a bug in react and not my code, is that everything works when I wrap the returned string in a <div> like so:

function Component() {
    let string = useSuspendingHook()

    return <div>{string}</div>
}

Also, would it be possible to have some extra info on the error what the mismatch in hydration actually is?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UnconfirmedA potential issue that we haven't yet confirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions