ascoders / react-native-image-viewer

🚀 tiny & fast lib for react native image viewer pan and zoom
MIT License
2.44k stars 577 forks source link

'renderImage' is not called if the url is an empty string #403

Open viniciusfont opened 4 years ago

viniciusfont commented 4 years ago

renderImage is not called when setting an empty url on the imageUrls element property. The url is fetched async inside the ImageMessage custom component The props is never printed on the console

const images = messages
  .filter(message => message.type === 'image')
  .map(message => {
    return {
      props: {
        message: message,
      },
    };
});
renderImage={props => {
  console.log('props', props);
  const {message} = props;
  return <ImageMessage message={message} />;
}}
viniciusfont commented 4 years ago

The library uses the url for calculate the 'height' and the 'width' of the child component. How can I change the image size async?