React Native Skia supports two rendering paradigms: Retained Mode and Immediate Mode. Understanding when to use each is key to building performant graphics applications. The Retained Mode allows for extremely fast animation with virtually zero FFI cost if the drawing list is updated at low frequency. Immediate mode allows for dynamic drawing lists but has a higher FFI cost. Since both modes use the sameDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/shopify/react-native-skia/llms.txt
Use this file to discover all available pages before exploring further.
<Canvas> element, you can seamlessly combine them in a single scene.
Retained Mode (Default)
In retained mode, you declare your scene as a tree of React components. React Native Skia converts this tree into a display list that is extremely efficient to animate with Reanimated. This approach is extremely fast and best suited for user interfaces and interactive graphics where the structure doesn’t change at animation time.Immediate Mode
In immediate mode, you issue drawing commands directly to a canvas on every frame. This gives you complete control over what gets drawn and when, but requires you to manage the drawing logic yourself. React Native Skia provides immediate mode through the Picture API. This mode is well-suited for scenes where the number of drawing commands changes on every animation frame, such as:- Games
- Generative art
- Particle systems
- Dynamic visualizations
Choosing the Right Mode
Here’s a guide to help you choose the appropriate rendering mode:| Scenario | Recommended Mode | Why |
|---|---|---|
| UI with animated properties | Retained | Zero FFI cost during animation |
| Data visualization | Retained | Structure usually fixed |
| Fixed number of sprites/tiles | Retained | With Atlas API, single draw call |
| Game with dynamic entities | Immediate | Entities created/destroyed |
| Procedural/generative art | Immediate | Dynamic drawing commands |
| Particle systems | Immediate | Variable particle count |
| Static graphics | Retained | Simplest API |