react-native-svg
react-native-svg copied to clipboard
[Windows] SVG disappearing when navigate
We are making a Windows app using react-native, react-navigation and react-native-windows.
But when we navigate to some page and go back to home screen, then our SVGs in home screen are all disappears. So I dive in to react-native-svg code base and found that Unload() method is the root cause of it.
https://github.com/software-mansion/react-native-svg/blob/main/windows/RNSVG/SvgView.cpp#L180
I am not expert of C++, If I remove this code It fixes, but I don't want to just remove it. So could you please take a look and provide the best solution for it? I am wondering is there any reverse solution like Reload or Load method.
Thanks.
The Unload() method is needed to prevent memory leaks (more info here), so we would have to go the Load route.
@marlenecota Thanks for answering. Yeah, I also believe there is a reason for using Unload(). I am not familiar with C++ and C#. Could you please provide how to implement the Load route if you have time. Thanks again.
@tgldr What version of react native, react native windows, and react native svg are you using?
@WilliamWelsh
I am using:
"react-native": "0.70.0", "react-native-windows": "0.70.19", "react-native-svg": "12.4.0"
@tgldr - this might have been fixed by #2195. Can you let me know if you're still seeing this with that change?
Hello @tgldr, Do you still have that issue?