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:
David Vacca 2020-04-07 17:34:46 -07:00 коммит произвёл Facebook GitHub Bot
Родитель ccef84d022
Коммит 22e318fab0
1 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -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 =>