Skip to content

Commit

Permalink
Update Image.d.ts (#39230)
Browse files Browse the repository at this point in the history
Summary:
I've seen that this throws a warning:
```
<ImageBackground source={{ uri: undefined }}>
```

But this is properly working, without a warning, thus, I believe the code is allowing it:
```
<ImageBackground source={isLoading ? undefined : { uri: 'https://....' }}>
```

## Changelog:

[GENERAL] [CHANGED] - Fixed `source` in `Image` type

Pull Request resolved: #39230

Test Plan: Not necessary. It's just a DOC change

Reviewed By: rshest

Differential Revision: D48939824

Pulled By: NickGerleman

fbshipit-source-id: fca2e07b7b4d4b947e365bb9d82fcf4cea484951
  • Loading branch information
BrodaNoel authored and facebook-github-bot committed Sep 4, 2023
1 parent 4dea635 commit 83885f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-native/Libraries/Image/Image.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export interface ImagePropsBase
*
* The currently supported formats are png, jpg, jpeg, bmp, gif, webp (Android only), psd (iOS only).
*/
source: ImageSourcePropType;
source?: ImageSourcePropType | undefined;

/**
* A string representing the resource identifier for the image. Similar to
Expand Down

0 comments on commit 83885f1

Please sign in to comment.