mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add missing type objectFit prop in image style type definition (#36249)
Summary: Following the [`initial commit`](https://github.com/facebook/react-native/commit/b2452ab216e28e004dc625dd8e1ad32351a79be9), the `objectFit` property have been implemented. However, it is not declared in the Typescript type files, making it unknown to the typescript compiler. Thus, when using this property in Typescript, we have the following issue:  Then, the purpose of this PR is to fix that by adding the missing property to the `ImageStyle` interface defined in the`StyleSheetTypes.d.ts` file. ## Changelog [GENERAL][FIXED] Add objectFit to the ImageStyle interface located in the StyleSheetTypes.d.ts file Pull Request resolved: https://github.com/facebook/react-native/pull/36249 Test Plan: To test it, create/use a typescript file and call the `Image` component with a `style` property. Then, check if the autocompletion provides you the right properties with the right type. For example:   Reviewed By: NickGerleman, rshest Differential Revision: D43665291 Pulled By: motiz88 fbshipit-source-id: bf136b8aeb9dd25ff0e696b747ef5805acf8028c
This commit is contained in:
committed by
Facebook GitHub Bot
parent
d504fb4145
commit
32d03c250c
+1
@@ -363,4 +363,5 @@ export interface ImageStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle {
|
||||
overlayColor?: ColorValue | undefined;
|
||||
tintColor?: ColorValue | undefined;
|
||||
opacity?: number | undefined;
|
||||
objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user