-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
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:
- Need a way to prevent component render on client side initial load facebook/react#8017 (comment)
- Document that you can't rely on React 16 SSR patching up differences facebook/react#10591 (comment)
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?
isman-usoh and ValentinH
Metadata
Metadata
Assignees
Labels
No labels