GetMatchStats should use hydration status#9007
Merged
sophie-macmillan merged 2 commits intomainfrom Oct 5, 2023
Merged
Conversation
sophie-macmillan
commented
Oct 4, 2023
| }>(matchUrl, options); | ||
|
|
||
| if (loading) return <Loading />; | ||
| if (loading || !hydrated) return <Loading />; |
Contributor
Author
There was a problem hiding this comment.
The other option for a fix here is to update the Placeholder component to use a min-height rather than a height.
Contributor
There was a problem hiding this comment.
I actually think approach is more robust as it addressed the underlying problem of rehydration mismatches.
DanielCliftonGuardian
approved these changes
Oct 4, 2023
abeddow91
approved these changes
Oct 4, 2023
|
Size Change: 0 B 🆕 Total Size: 0 B |
Contributor
Author
|
Closing as superseded by #9008, which allows us to still serve the component from the server |
Contributor
Author
|
Reopening, as we have had other reports of issues with the GetMatchStat component, which will be fixed by this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change?
This updates the Placeholder component to check the hydrationStatus and return the Loading placeholder if not hydrated
Why?
The MatchStats component was breaking when there were a lot of names, this is because the serverside rendered comonent wasn't tall enough. Quick fix is to render the placeholder if not hydrated.
Fixes #9006
Screenshots