Skip to content

Conversation

@alvessteve
Copy link
Contributor

@alvessteve alvessteve commented Feb 20, 2023

Summary

After reviewing the doc Image, the typescript compiler doesn't know the following properties:

  • src
  • srcSet
  • referrerPolicy
  • tintColor
  • objectFit

But after reviewing the source code and this commit, the objectFit property isn't one related to the Image component but to the style props, making the official doc outdated. So, an issue in the react-native-website repo have been created and I decided to not include the objectFit prop in this PR.

So, this PR includes those properties: sec, secSet, referrerPolicy and tintColor

Changelog

[GENERAL][FIXED] Add src, srcSet, referrerPolicy, tintColor to Image.d.ts declaration file

Test Plan

To test it, create/use a typescript file and call the Image component. Then, check if the autocompletion provides you the right properties with the right type. For example, for the referrerPolicy one:

Capture d’écran 2023-02-20 à 20 50 34

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 20, 2023
@rshest
Copy link
Contributor

rshest commented Feb 20, 2023

Please consider adding a test plan, otherwise looks reasonable.

@facebook-github-bot
Copy link
Contributor

@rshest has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@alvessteve
Copy link
Contributor Author

sure, thank for your feedbacks :) i updated my previous message with the test plan.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Feb 23, 2023
@facebook-github-bot
Copy link
Contributor

@rshest merged this pull request in 74cb607.

OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
…k#36214)

Summary:
After reviewing the doc [`Image`](https://reactnative.dev/docs/image), the typescript compiler doesn't know the following properties:
- src
- srcSet
- referrerPolicy
- tintColor
- objectFit

But after reviewing the source code and this [`commit`](facebook@b2452ab), the `objectFit` property isn't one related to the Image component but to the `style` props, making the official doc outdated. So, an [`issue in the react-native-website repo`](facebook/react-native-website#3579) have been created and I decided to not include the objectFit prop in this PR.

So, this PR includes those properties: sec, secSet, referrerPolicy and tintColor

## Changelog

[GENERAL][FIXED] Add src, srcSet, referrerPolicy, tintColor to Image.d.ts declaration file

Pull Request resolved: facebook#36214

Reviewed By: NickGerleman

Differential Revision: D43437894

Pulled By: rshest

fbshipit-source-id: 497426490134aba0a474c49bf8bab9131f2e5845
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants