Skip to content

SSR react hydrate mismatch problem #29

@izzappel

Description

@izzappel

If using the currentBreakpoint for rendering different elements dependent on the breakpoint react cannot hydrate correctly if the guessedBreakpoint does not match with the client. (I use the user-agent from the request to guess the breakpoint on server side. Obviously this does not get always the correct breakpoint.)

Related react issues:

It would be nice if the library supports this case. I think it should not calculate the currentBreakpoint dependent on the window width in the constructor if there is a guessedBreakpoint. If there is a guessedBreakpoint the currentBreakpoint should be calculated from the window width in componentDidMount.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions