Align ImageStyle overflow prop type and compose function type#51285
Closed
coado wants to merge 1 commit into
Closed
Align ImageStyle overflow prop type and compose function type#51285coado wants to merge 1 commit into
coado wants to merge 1 commit into
Conversation
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D74574293 |
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D74574293 |
23a1bc2 to
9146f94
Compare
…ok#51285) Summary: Pull Request resolved: facebook#51285 The `composeStyles` function should correctly determine the type of the input styles (`ViewStyle`, `ImageStyle`, `TextStyle`) base on the output type: ```ts const combinedStyle8: StyleProp<ImageStyle> = StyleSheet.compose( // ts-expect-error composeTextStyle, composeTextStyle, ); ``` This diff adds generic type checking for `compose` function and fixes `ImageStyle` overflow prop type which accepted `scroll` property (which wasn't previously accepted in manual types) and which enables type system to distinguish `ImageStyle` from `ViewStyle` and `TextStyle`: previous: ```ts overflow?: 'visible' | 'hidden' | 'scroll' ``` current: ```t overflow?: 'visible' | 'hidden' ``` Changelog: [Internal] Reviewed By: huntie Differential Revision: D74574293
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D74574293 |
Contributor
|
This pull request has been merged in 4d0f2b2. |
Collaborator
|
This pull request was successfully merged by @coado in 4d0f2b2 When will my fix make it into a release? | How to file a pick request? |
react-native-bot
pushed a commit
that referenced
this pull request
May 19, 2025
Summary: Pull Request resolved: #51285 The `composeStyles` function should correctly determine the type of the input styles (`ViewStyle`, `ImageStyle`, `TextStyle`) base on the output type: ```ts const combinedStyle8: StyleProp<ImageStyle> = StyleSheet.compose( // ts-expect-error composeTextStyle, composeTextStyle, ); ``` This diff adds generic type checking for `compose` function and fixes `ImageStyle` overflow prop type which accepted `scroll` property (which wasn't previously accepted in manual types) and which enables type system to distinguish `ImageStyle` from `ViewStyle` and `TextStyle`: previous: ```ts overflow?: 'visible' | 'hidden' | 'scroll' ``` current: ```t overflow?: 'visible' | 'hidden' ``` Changelog: [Internal] Reviewed By: huntie Differential Revision: D74574293 fbshipit-source-id: 751a44f2d3cd43055d93031343995f16ef87b185
Collaborator
|
This pull request was successfully merged by @coado in 9858e1e When will my fix make it into a release? | How to file a pick request? |
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.
Summary:
The
composeStylesfunction should correctly determine the type of the input styles (ViewStyle,ImageStyle,TextStyle) base on the output type:This diff adds generic type checking for
composefunction and fixesImageStyleoverflow prop type which acceptedscrollproperty (which wasn't previously accepted in manual types) and which enables type system to distinguishImageStylefromViewStyleandTextStyle:previous:
current:
Changelog:
[Internal]
Differential Revision: D74574293