-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix hydration mismatches with
React.useId
(#2542)
* Current behavior for useId * fix(styled): Ensure no hydration mismatch with React.useId * yarn changeset * Update snapshots * Dirty fix for enzyme matchers * Fragment -> Noop * Apply same pattern to class-names and emotion-element * tweak fragment unwrapping in `@emotion/jest` * Fixed enzyme-related serialization tests * Fix more cases and add new tests * add tests for avoiding id mismatches when using css prop and ClassNames component * Fix flow errors * Reset html before each rehydration test * tweak changesets Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
- Loading branch information
Showing
14 changed files
with
620 additions
and
127 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
'@emotion/jest': minor | ||
--- | ||
|
||
author: @eps1lon | ||
author: @Andarist | ||
|
||
Adjusted the serialization logic to unwrap rendered elements from Fragments that had to be added to fix hydration mismatches caused by `React.useId` usage (the upcoming API of the React 18). |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@emotion/react': minor | ||
'@emotion/styled': minor | ||
--- | ||
|
||
Fixed hydration mismatches if `React.useId` (the upcoming API of the React 18) is used within a tree below our components. |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.