Skip to content

Commit

Permalink
Avoid passing analyticsTag prop to native if this is set to null
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mdvacca authored and facebook-github-bot committed Apr 8, 2020
1 parent ccef84d commit 22e318f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Libraries/Image/Image.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 =>
Expand Down

0 comments on commit 22e318f

Please sign in to comment.