react-native-image-placeholder
react-native-image-placeholder copied to clipboard
children is rendered 2 times on successful loading of image. Why?
In the code there are two references to children props
where it is rendrerd. The first one here https://github.com/TuNguyenThanh/react-native-image-placeholder/blob/64ca8c7aa668c7c0783c45ab2478d729053351c9/index.js#L50 and the second one here https://github.com/TuNguyenThanh/react-native-image-placeholder/blob/64ca8c7aa668c7c0783c45ab2478d729053351c9/index.js#L73
If I close my network so the network image is inaccessible then only the second one will be rendered. But with a successful loading both will rendered.
I could not figure out why ?
Do we really need that?
thanks for helping me understand.
You can fix it by removing from line 69 to 76 { this.props.children && <View style={styles.viewChildrenStyles}> { this.props.children } </View> }