Avoid passing analyticsTag prop to native if this is set to null
Summary: This diff avoids passing the analyticsTag prop to native if this is set to null changelog: [internal] internal optimization Reviewed By: TheSavior Differential Revision: D20904498 fbshipit-source-id: f1ea1e5aa3199ef073668df86ca7cf6e20f70c5b
This commit is contained in:
Родитель
ccef84d022
Коммит
22e318fab0
|
@ -295,10 +295,13 @@ let Image = (props: ImagePropsType, forwardedRef) => {
|
|||
return (
|
||||
<ImageAnalyticsTagContext.Consumer>
|
||||
{analyticTag => {
|
||||
const nativePropsWithAnalytics = {
|
||||
...nativeProps,
|
||||
analyticTag: analyticTag,
|
||||
};
|
||||
const nativePropsWithAnalytics =
|
||||
analyticTag !== null
|
||||
? {
|
||||
...nativeProps,
|
||||
analyticTag: analyticTag,
|
||||
}
|
||||
: nativeProps;
|
||||
return (
|
||||
<TextAncestor.Consumer>
|
||||
{hasTextAncestor =>
|
||||
|
|
Загрузка…
Ссылка в новой задаче