Open Jatverma54 opened 3 years ago
+1
Any temporary fix for this ?
Bump
Facing the same issue
@Jatverma54 @bruuuuuuuce Can you share a repo with minimal implementation where this issue is occurring? I can look into it and submit a PR if possible.
Are you conditionally rendering ImageViewing
component?
I found it occurs if you change imageIndex
prop in onRequestClose
callback or somehow modify imageIndex
while fadeout. My case:
const [currentIndex, setCurrentIndex] = useState(null)
// ...
visible={typeof currentIndex === 'number'}
imageIndex={currentIndex}
onRequestClose={() => setCurrentIndex(null)}
// ...
Changed to:
const [isVisible, setIsVisible] = useState(false)
const [currentIndex, setCurrentIndex] = useState(0)
// ...
visible={isVisible}
imageIndex={currentIndex}
onRequestClose={() => setIsVisible(false)}
// ...
Solution: don't use same state for visible
and imageIndex
props
For my case, I changed this:
{fullscreenImg && !isPDF && (
<ImageView
images={fullscreenImages}
imageIndex={0}
visible={fullscreenImg}
onRequestClose={() => setFullscreenImg(false)}
/>
)}
To the following:
<ImageView
images={fullscreenImages}
imageIndex={0}
visible={fullscreenImg}
onRequestClose={() => setFullscreenImg(false)}
/>
node_modules\react-native\Libraries\LogBox\LogBox.js:173:8 in registerError