seekshiva / react-native-remote-svg

Adds support for loading svg images in React Native
MIT License
184 stars 71 forks source link

loop images crashed app #13

Closed ihusak closed 2 years ago

ihusak commented 6 years ago

Hello, I have a looping listView with small svg images, when its rendering is ok, but when I start scrolling app isn't responsing and broke. Please help me. image

seekshiva commented 6 years ago

@Husak93 It is really a platform limit on how many WebViews can be on a screen at a time. When you scroll fast, lot of browser instances are opened up for each use of the Image component. That was the likely cause of the bug.

If you pretty much know the svg that gets used in the list (like the three svg in your sample code), you could try using react-native-svg package. You can define each of the SVG as components and import and use them. That should prevent the crash.

You can use this library if you have remote images that you don't know at the time of development what the image would be (eg, user generated content).

ihusak commented 6 years ago

@seekshiva thanks, this works. Youre plugin is cool!