react-native-svg-transformer icon indicating copy to clipboard operation
react-native-svg-transformer copied to clipboard

Local SVG disappearing just before transition from a given screen

Open t3chcrazy opened this issue 3 years ago • 10 comments

https://user-images.githubusercontent.com/43211102/128126864-51344805-dc43-40cb-823e-d115fb0b39ab.mp4

I am facing this bug where the local svgs disappear after navigating back from that screen which contains those svgs. In this case, the svgs are positioned absolutely on both merchant and refund list screen, but disappear as soon as I press back. Any help is appreciated.

react: 17.0.1 react-native: 0.64.2 react-native-svg: 12.1.1 react-native-svg-transformer: 0.14.3 @react-navigation/native-stack: 6.0.0 @react-navigation/native: 6.0.0

t3chcrazy avatar Aug 04 '21 05:08 t3chcrazy

Thanks @t3chcrazy ! I'm not really sure how I could help you with this one. Basically instead of a whole app, there would need to be some simpler example to reproduce the issue that you are having.

kristerkari avatar Aug 30 '21 16:08 kristerkari

I'm also experiencing this with the same stack, did you manage to get over it somehow ?

dev-andremonteiro avatar Apr 12 '22 19:04 dev-andremonteiro

same problem here too.

sanketkheni01 avatar May 12 '22 13:05 sanketkheni01

@dev-andremonteiro No I couldn't, I had to replace them with png files

t3chcrazy avatar May 14 '22 14:05 t3chcrazy

I solved it by switching to stack navigation from native stack. I know for someone it is not possible to just let go native stack's performance. But for me it was fine.

sanketkheni01 avatar May 14 '22 14:05 sanketkheni01

Switching back to navigation stack from native stack worked for me.

dev-andremonteiro avatar May 17 '22 02:05 dev-andremonteiro

This is still a problem for native stack and react-native-screens. Anyone have a solution for that? It looks really bad.

kneza23 avatar Aug 29 '22 11:08 kneza23

Thanks @t3chcrazy ! I'm not really sure how I could help you with this one. Basically instead of a whole app, there would need to be some simpler example to reproduce the issue that you are having.

You just need to have some local png files rendered inside a NativeStackNavigator imported from @react-navigation/native-stack.

Then just go back on android for example and you will see the local icons disappearing before the screen is unmounted from the stack.

kneza23 avatar Aug 29 '22 11:08 kneza23

Maybe it is because of animation duration of navigator that is defaulted on 350ms. Animation occurs on native thread and imported icons from javascript side are removed from memory too soon?

kneza23 avatar Aug 29 '22 11:08 kneza23

https://github.com/software-mansion/react-native-screens/issues/773

swikars1 avatar Sep 07 '22 12:09 swikars1