-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only insert key on react elements (#188)
* Only format count/ordinal as number if they are one * changeset * Declare explicit peer dep on React We need to use utilities such as cloneElement and isValidElement * Clone element when necessary to inject key We're re-creating any object that doesn't have a key and injecting a key into it, which is causing non-react elements such as arrays and `expect.any` style matchers to be mutated into a shape that can't then be used. Arrays are valid as children and should be preserved, and expect.any is useful for matching translations. We should be using React's cloneElement when we need to mutate an element in this way so that it can still be tested against when injecting a key prop into it. * changeset
- Loading branch information
1 parent
6fd7800
commit cf07b33
Showing
5 changed files
with
40 additions
and
3 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,5 @@ | ||
--- | ||
'@shopify/i18next-shopify': patch | ||
--- | ||
|
||
Don't break objects when inserting key prop |
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,5 @@ | ||
--- | ||
'@shopify/i18next-shopify': patch | ||
--- | ||
|
||
Only format count/ordinal as number if they are one |
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