Repository navigation
fix(theme): replace arrays when useTheme and withTheme merge a theme - #5317
Open
Priyanshu0007 wants to merge 1 commit into
Open
Priyanshu0007 wants to merge 1 commit into
Priyanshu0007 wants to merge 1 commit into
Conversation
useTheme(overrides) and withTheme merged with deepmerge from @callstack/react-theme-provider, which joins arrays. An easing override gave 8 numbers and had no effect. Both now merge with safeMerge, as ThemeProvider, PaperProvider and the theme prop do, so arrays are replaced and platform colors are kept as they are. Fixes callstack#5311
This branch has not been deployed
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.
Motivation
useTheme(overrides)andwithThemejoined arrays, so an easing override gave 8 numbers and did nothing. They now replace arrays, likeThemeProviderand thethemeprop.Related issue
Fixes #5311
Screenshots / Videos
Before / after on web, iOS, Android:
issue-5311-before-android.mp4
issue-5311-before-web.mp4
issue-5311-after-android.mp4
issue-5311-before-ios.mp4
issue-5311-after-ios.mp4
issue-5311-after-web.mp4
Test plan
Call
useTheme({ motion: { easing: { standard: [0.9, 0, 0.1, 1] } } }), or pass thatthemeto awithThemecomponent. The curve has those 4 numbers.