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?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
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?