-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add tintColor prop to Image component #34534
feat: Add tintColor prop to Image component #34534
Conversation
Base commit: 10ea6fb |
@jacdebug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Base commit: 10ea6fb |
Libraries/Image/ImageProps.js
Outdated
@@ -14,6 +14,7 @@ import type {SyntheticEvent, LayoutEvent} from '../Types/CoreEventTypes'; | |||
import type {EdgeInsetsProp} from '../StyleSheet/EdgeInsetsPropType'; | |||
import type {ImageSource} from './ImageSource'; | |||
import type {ViewStyleProp, ImageStyleProp} from '../StyleSheet/StyleSheet'; | |||
import type {____ColorValue_Internal} from '../StyleSheet/StyleSheetTypes'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'll want to import the type like this:
import type {ColorValue} from './StyleSheet'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I've just updated it.
@jacdebug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This pull request was successfully merged by @gabrieldonadel in 7a6f0e4. When will my fix make it into a release? | Upcoming Releases |
Summary
This adds the
tintColor
prop to the Image component to replace the non-standardstyle.tintColor
as requested on #34424, so that React Native for Web does not have to deopt styles for Image rendering. I didn't have to change anything on Android astintColor
was already being passed down to the native component as a prop. This PR also updates RNTester ImageExample in order to facilitate the manual QA.Changelog
[General] [Added] - Add tintColor prop to Image component
Test Plan
tintColor
prop through theTint Color
sectionScreen.Recording.2022-08-30.at.10.07.40.mov