mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/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