react-native-image-placeholder icon indicating copy to clipboard operation
react-native-image-placeholder copied to clipboard

children is rendered 2 times on successful loading of image. Why?

Open efleurine opened this issue 6 years ago • 1 comments

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.

efleurine avatar Jul 08 '18 16:07 efleurine

You can fix it by removing from line 69 to 76 { this.props.children && <View style={styles.viewChildrenStyles}> { this.props.children } </View> }

sjonchhe avatar Jun 16 '20 06:06 sjonchhe