11import React , { PureComponent } from 'react' ;
22import { View } from 'react-native' ;
33import PropTypes from 'prop-types' ;
4- import lodashGet from 'lodash/get' ;
54import Log from '../libs/Log' ;
65import styles from '../styles/styles' ;
76import FullscreenLoadingIndicator from './FullscreenLoadingIndicator' ;
@@ -45,7 +44,7 @@ class ImageWithSizeCalculation extends PureComponent {
4544 this . imageLoadingStart = this . imageLoadingStart . bind ( this ) ;
4645 this . imageLoadingEnd = this . imageLoadingEnd . bind ( this ) ;
4746 this . onError = this . onError . bind ( this ) ;
48- this . imageLoadedSuccessfuly = this . imageLoadedSuccessfuly . bind ( this ) ;
47+ this . imageLoadedSuccessfully = this . imageLoadedSuccessfully . bind ( this ) ;
4948 }
5049
5150 onError ( ) {
@@ -60,13 +59,11 @@ class ImageWithSizeCalculation extends PureComponent {
6059 this . setState ( { isLoading : false } ) ;
6160 }
6261
63- imageLoadedSuccessfuly ( event ) {
64- if ( ! lodashGet ( event , 'nativeEvent.width' , false ) || ! lodashGet ( event , 'nativeEvent.height' , false ) ) {
65- // Image didn't load properly
66- return ;
67- }
68-
69- this . props . onMeasure ( { width : event . nativeEvent . width , height : event . nativeEvent . height } ) ;
62+ imageLoadedSuccessfully ( event ) {
63+ this . props . onMeasure ( {
64+ width : event . nativeEvent . width ,
65+ height : event . nativeEvent . height ,
66+ } ) ;
7067 }
7168
7269 render ( ) {
@@ -89,7 +86,7 @@ class ImageWithSizeCalculation extends PureComponent {
8986 onLoadStart = { this . imageLoadingStart }
9087 onLoadEnd = { this . imageLoadingEnd }
9188 onError = { this . onError }
92- onLoad = { this . imageLoadedSuccessfuly }
89+ onLoad = { this . imageLoadedSuccessfully }
9390 />
9491 { this . state . isLoading && (
9592 < FullscreenLoadingIndicator
0 commit comments