Nov 20, 2024
Optimizing SVG Rendering in React Native: From React-Native-SVG to Expo-Image
Learn how to optimize SVG rendering in React Native by switching from React-Native-SVG to Expo-Image, boosting app performance and reducing render times.
Author


Book a call
Table of Contents
react-native-svg to render svg components, this blog is your life-saver! We will discuss how to optimize SVG performance and inspect if we still need react-native-svg?What is SVG ?
Why react-native-svg ?
- Dynamic SVGs: It allows us to draw SVGs dynamically, meaning a single svg component can accept various props like dimensions and color which will help us to render svg on runtime.
- Ease of Maintenance: Since a single component can be reused in many places, it’s very easy to maintain the codebase and a little code tweaking is required whenever a new property is required.
What is the problem with react-native-svg?
- SVG Rendering: The SVGs rendered by the library aren’t “true” SVGs. They’re React Native components rendered natively.
- Performance Problems: Rendering 500 svg at the same time using
react-native-svgtook a staggering 9–10 seconds!
Imagine you have a huge list of items rendered in SVG cards. This 9-second delay was a huge compromise, so we need a solution that could render without such performance hits.
The Solution
- SVG sources need to be predefined (dimensions, colors, tags, etc.).
- Dynamically generated SVGs are not supported.
1. Converting React Native SVGs to XML
You can create a SvgGenerator component that converts functional SVG components into XML. This component when wrapped around child components will traverse its children and store the xml in an array.
2. Pre-generating and Storing SVGs in Async-Storage
After the conversion of svg into xml, you can use Base-64 library to convert those xml into base64 uri string and store it in AsyncStorage, so that we can retrieve it from the disk.
You can choose to use several optimization techniques given by Expo-Image while rendering this svg to increase performance. For example you can use the prefetch method to load an array of images even before rendering. You can leverage the cachePolicy property of Expo-Image to store images in caches which will further reduce the render time!
The Results
By implementing this approach, when you render 500 SVGs at a time, you can notice render time is decreased drastically from 9 seconds to an average of 2.5 seconds.
Conclusion
react-native-svg to native SVG rendering with Expo-Image will provide significant performance gains in your React Native project. By leveraging caching and pre-generating SVGs, you can achieve a slick, high-performing UI without compromising on the flexibility of dynamic SVGs.This approach may add some initial complexity to the setup but greatly enhances the user experience. If you’re facing similar performance issues with dynamic SVGs, consider exploring native SVG rendering as a solution.
Subscribe to Our Newsletter
Subscribe to RSS
Press & Media Hub RSS FeedRelated Articles.
More from the engineering frontline.
Dive deep into our research and insights on design, development, and the impact of various trends to businesses.

Jun 27, 2026
Building a Resilient Hybrid-Cloud Network with WireGuard HA, Route-Based Failover, and Deep Observability

Jun 19, 2026
We Built a 114-Second AWS-to-Azure Failover. Here’s What We Learned

Jun 12, 2026
Cloud-Native and Cloud-Agnostic Are Not Ideologies; They Are Business-Stage Decisions

Jun 8, 2026
Geeklego: The Open-Source Design System Built to Work With AI

May 18, 2026
Your Vibe Code Has No Memory. DESIGN.md Fixes That.

May 14, 2026