From bcf493f346e320d683ced471750bb8d8e3b1a5ae Mon Sep 17 00:00:00 2001 From: Steve Alves-Blyt Date: Fri, 17 Feb 2023 18:32:18 -0800 Subject: [PATCH] fix: add width, height and crossOrigin props on Image type declaration file (#36196) Summary: According this Issue [`https://github.com/facebook/react-native/issues/36182`](https://github.com/facebook/react-native/issues/36182), the typescript compiler doesn't know the `width`, `height` and `crossOrigin` props for the `Image` component although they are taken in account in the code, [docs](https://reactnative.dev/docs/image#crossorigin) and the flow types. ## Changelog [GENERAL] [FIXED] - Fix missing `height`, `width`, `crossOrigin` props on Typescript Image.d.ts file Pull Request resolved: https://github.com/facebook/react-native/pull/36196 Reviewed By: christophpurrer Differential Revision: D43406094 Pulled By: rshest fbshipit-source-id: 547ed142d7c39c361d195275b79b0885ef829ba1 --- Libraries/Image/Image.d.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Libraries/Image/Image.d.ts b/Libraries/Image/Image.d.ts index dd2c089e75a4be..3391ad1f93a265 100644 --- a/Libraries/Image/Image.d.ts +++ b/Libraries/Image/Image.d.ts @@ -254,6 +254,28 @@ export interface ImagePropsBase * See https://reactnative.dev/docs/image#alt */ alt?: string | undefined; + + /** + * Height of the image component. + * + * See https://reactnative.dev/docs/image#height + */ + height?: number | undefined; + + /** + * Width of the image component. + * + * See https://reactnative.dev/docs/image#width + */ + width?: number | undefined; + + /** + * Adds the CORS related header to the request. + * Similar to crossorigin from HTML. + * + * See https://reactnative.dev/docs/image#crossorigin + */ + crossOrigin?: 'anonymous' | 'use-credentials'; } export interface ImageProps extends ImagePropsBase {