ascoders / react-native-image-viewer

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

Can't perform a React state update on an unmounted component. #311

Open io-pan opened 5 years ago

io-pan commented 5 years ago

When unmounting ImageViewer quickly, i.e before image appears, I get

Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.

linxianxi commented 4 years ago

shit , after i change my code ,this probrem still occur!!!!

same !how to resolve it???? @ascoders

linxianxi commented 4 years ago

how to resolve it at last? @blackjack0v0 @io-pan

orcunorcun commented 4 years ago

Same Here!

    "react": "16.9.0",
    "react-native": "0.61.4",
    "react-native-scrollable-tab-view": "1.0.0",

index.bundle?platfor…&minify=false:29307 Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method. in ImageViewer (at CustomSlider.js:38) in RCTView (at AppContainer.js:101) in RCTView (at AppContainer.js:119) in AppContainer (at Modal.js:250) in RCTView (at Modal.js:271) in RCTModalHostView (at Modal.js:258)

tintheanh commented 4 years ago

It's late but for anyone who has the same issue, putting the width and height of images will fix it, also optimize the performance.

summerkiflain commented 4 years ago

Putting width and height with url doesn't solve the issue for me, P.S I can't see loading indicator after putting width and height. this library has many state updating issues, I get Warning: Cannot update during an existing state transition (such as within 'render'). Render methods should be a pure function of props and state. also when scrolling quickly through the images.

busykid commented 3 years ago

same here