Friday 19 March 2021

React Rerender in case of cache disable in Chrome

I have a react app where I am using 'react-image-pan-zoom-rotate' for showing images.

https://github.com/mgorabbani/react-image-pan-zoom-rotate

I basically have a url of external service that provides the image which I am passing to both of the below libraries to render the image.

Recently I have started facing a issue(only in Chrome) where if the cache is disabled, then whenever i click on the image in browser or use any controls provided by this component it rerenders it which results in another call to the external image server. And this happens whenever i click/interact with the image or the view generated by the above react library.

Now I have started using https://github.com/theanam/react-awesome-lightbox/blob/master/src/index.js and it does not have any such issues with cache disabled.

Any idea why this could be happening ?



from React Rerender in case of cache disable in Chrome

No comments:

Post a Comment