booyeu / react-native-reanimated-viewer

A high performance image viewer in react-native created from react-native-reanimated.
130 stars 12 forks source link

[Android] - Crashes when closed image is out of screen #9

Closed crank-chips closed 1 year ago

crank-chips commented 1 year ago

To reproduce, use an example from the repo. Add more images so the list is longer than the screen (eg. 30 images). Wrap images in ScrollView with vertical scrolling. Open the first image and scroll forward til the end. Close the image view by swiping down. Open the first image again. It doesn't happen on iOS

https://github.com/BooYeu/react-native-reanimated-viewer/assets/17419029/72f640d0-915e-415a-a563-49adfd06a08c

Logs:


Invariant Violation: [469,"RCTImageView",31,{"resizeMode":"contain","width":"<<NaN>>","height":"<<NaN>>","overflow":"hidden","position":"absolute","transform":[{"translateX":"<<NaN>>"},{"translateY":"<<NaN>>"}],"collapsable":false,"shouldNotifyLoadEvents":false,"src":[{"uri":"https://img2.baidu.com/it/u=1835117106,152654887&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=556"}],"defaultSrc":null,"loadingIndicatorSrc":null,"accessibilityState":{}}] is not usable as a native method argument

This error is located at:
    in RCTImageView (created by TextAncestorContext)
    in BaseImage (created by AnimatedComponent(Image))
    in AnimatedComponent(Image)
    in Unknown
    in RCTView (created by View)
    in View
    in RCTView (created by View)
    in View
    in Wrap (created by AnimatedComponent(Wrap))
    in AnimatedComponent(Wrap)
    in Unknown (created by GestureDetector)
    in GestureDetector
    in RNGestureHandlerRootView (created by GestureHandlerRootView)
    in GestureHandlerRootView
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer (created by Modal)
    in RCTView (created by View)
    in View (created by Modal)
    in VirtualizedListContextResetter (created by Modal)
    in RCTModalHostView (created by Modal)
    in Modal
    in Unknown
    in RCTView (created by View)
    in View (created by ImageViewerPage)
    in ImageViewerPage (created by App)
    in Provider (created by App)
    in App (created by withDevTools(App))
    in withDevTools(App)
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in main(RootComponent), js engine: hermes
llr101 commented 1 year ago

v1.2.2 fixed it ~