mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Log ImageSource uris that are not using Facebook domain
Summary: This diff adds logging to uncover what are the ReactNative screens that are rendering images using NON-Facebook domains changelog: [internal] internal Reviewed By: yungsters Differential Revision: D29179990 fbshipit-source-id: 85f6380848d1ac1461419bc29c4666be389fb87a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
6be4f2b2c8
commit
14ca57b435
@@ -13,7 +13,7 @@ import ImageViewNativeComponent from './ImageViewNativeComponent';
|
||||
import * as React from 'react';
|
||||
import StyleSheet from '../StyleSheet/StyleSheet';
|
||||
import TextAncestor from '../Text/TextAncestor';
|
||||
|
||||
import ImageSourceInjection from './ImageSourceInjection';
|
||||
import ImageAnalyticsTagContext from './ImageAnalyticsTagContext';
|
||||
import flattenStyle from '../StyleSheet/flattenStyle';
|
||||
import resolveAssetSource from './resolveAssetSource';
|
||||
@@ -132,8 +132,13 @@ let Image = (props: ImagePropsType, forwardedRef) => {
|
||||
props.loadingIndicatorSource,
|
||||
);
|
||||
|
||||
if (source && source.uri === '') {
|
||||
console.warn('source.uri should not be an empty string');
|
||||
if (source) {
|
||||
const uri = source.uri;
|
||||
if (uri === '') {
|
||||
console.warn('source.uri should not be an empty string');
|
||||
} else if (ImageSourceInjection.unstable_enableUriAnalytics) {
|
||||
ImageSourceInjection.unstable_enableUriAnalytics(uri);
|
||||
}
|
||||
}
|
||||
|
||||
if (props.src) {
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow strict
|
||||
*/
|
||||
|
||||
export default {
|
||||
unstable_enableUriAnalytics: (null: ?(uri: string) => void),
|
||||
};
|
||||
Reference in New Issue
Block a user