Rive WebGL Animations in React Causing Flickering/Re-rendering of Other SVG Elements

We are experiencing an issue in our React (Next.js) application where playing Rive animations using @rive-app/react-webgl2 causes other, unrelated SVG elements on the page to flicker or appear to re-render. This flickering is specifically tied to moments when Rive animations are either starting, actively playing, or potentially during their teardown/idling phase after playing once.

Key Observations & Debugging Steps:

  1. Isolation:

  • If the Rive component is removed entirely from the application, the flickering of other SVGs stops completely.

  • If the Rive component is present but configured with autoplay={false} and no triggers (clicks, hovers, mount-based plays) are active (i.e., the Rive canvas is initialized but effectively idle and no animations are ever played), the flickering does not occur.

  • The flickering specifically manifests when a Rive animation is actually played (e.g., on component mount for an autoplay={false} instance, or when triggered by a parent component).


  1. Nature of the "Flicker" I’m talking about:

  • The flicker/re-render of the other SVGs happens during "rendering type events" – for example, when these other SVGs have their own hover effects triggered, or when content (like the modal containing the Rive animation) loads and initiates the Rive animation.


  1. Attempts to Mitigate (React Component Logic):

  • We initially experimented with aggressively mounting/unmounting the Rive WebGL canvas (RiveWrapper component) for autoplay={false} instances, so it was only in the DOM when an animation was playing. This did not solve the flicker, suggesting the setup/teardown itself was disruptive.

  • Our current approach is to keep the Rive WebGL canvas mounted for the lifetime of our Dot component. For autoplay={false} instances, we explicitly call rive.play("STATE_MACHINE_NAME") when an animation needs to run (on mount, or due to an external trigger).

  • We briefly experimented with calling rive.pause() in the onStop callback for autoplay={false} instances. This led to a BindingError: Cannot pass deleted object as a pointer of type Artboard on subsequent rive.play() calls, so we removed the explicit rive.pause(). The BindingError itself might indicate sensitivities in the Rive runtime's internal state management during play/stop cycles.

4 .Renderer Consideration:

  • We considered using the Rive Canvas 2D renderer (@rive-app/react-canvas), but it does not render our specific .riv file's blended gradients correctly, making it unsuitable for our visual requirements.

Our Current Wrapper Structure (Simplified):

  • A React component wraps a RiveWrapper React component.

  • RiveWrapper uses the useRive hook from @rive-app/react-webgl2.

  • The RiveWrapper is always mounted if Dot is mounted.

  • Props to the component include state (for Rive state machine state/input), autoplay, size, loopInterval, and an externalTriggerSignal.

  • Inside RiveWrapper, a useEffect hook listens to changes in these props. When a trigger occurs or on initial mount (for autoplay={false}):

  • rive.fireStateAtPath(triggerName, NESTED_ARTBOARD_PATH) is called.

  • If autoplay is false, rive.play(TOP_LEVEL_STATE_MACHINE) is called.

  • The onStop callback from useRive is currently only used for logging, no explicit pause() calls are made there now.

Questions for Rive Support:

  1. What mechanisms within the Rive WebGL runtime could cause its rendering operations (especially during the startup of an animation or frame-by-frame playback) to interfere with the browser's rendering of other, unrelated SVG elements, leading to visual flickering or apparent re-draws of those SVGs?

  2. Are there known best practices for minimizing the performance footprint or rendering contention of Rive WebGL animations in a complex React application, particularly when animations are short-lived, triggered by user interactions, or occur concurrently with other UI updates (like modal displays)?

  3. Could specific features within a .riv file (e.g., certain types of listeners, constraints, or even unused but present interactive inputs like mouse tracking) cause the Rive runtime to engage in background processing or event listening that might contribute to these rendering conflicts, even if those features aren't actively being driven by our React code for a given animation state?

  4. Is there a recommended approach for managing the lifecycle of Rive animations (initial play, subsequent plays, ensuring true idleness after a one-shot animation) when using useRive with autoplay={false} to ensure the most "browser-friendly" behavior in terms of resource usage and minimizing impact on concurrent rendering tasks?

  5. Regarding the previous BindingError: Cannot pass deleted object as a pointer of type Artboard when using rive.pause() in onStop followed by a rive.play(): is this an expected limitation, or does it suggest a specific way pause/play should be managed for state machines that are meant to be retriggered?

Information We Can Provide:

  • The .riv file in question

  • Chrome (Version 136.0.7103.93 (Official Build) (arm64)) / Arc (Version 1.93.0 (62424))

  • A minimal reproducible example (we will try to create one if helpful, though it might be challenging due to the interaction with other page elements).