facebook / facebook/relay

Client-only data triggers React checksum mismatch

Open
#1,957 3 comments 0 reactions 0 assignees View on GitHub
discussion
Dominant language
Rust
Stars
19k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

We cache server HTML in a CDN and make a user data query on the client only. This updates the top navigation bar markup on the client to include the logged-in user's name, etc. Doing this triggers a React checksum mismatch since the render tree is different. Delaying the query triggers other errors, like setting state in `componentDidMount`.

Are there any best practices for doing client-only queries? (directives, etc) How does one avoid this mismatch?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.