Skip to content

Commit

Permalink
fix: add width, height and crossOrigin props on Image type declaratio…
Browse files Browse the repository at this point in the history
…n 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: #36196

Reviewed By: christophpurrer

Differential Revision: D43406094

Pulled By: rshest

fbshipit-source-id: 547ed142d7c39c361d195275b79b0885ef829ba1
  • Loading branch information
alvessteve authored and facebook-github-bot committed Feb 18, 2023
1 parent a4b41d2 commit bcf493f
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Libraries/Image/Image.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit bcf493f

Please sign in to comment.