From d3bc913bcf70e62df6cea5b5a08d0135c965f9ff Mon Sep 17 00:00:00 2001 From: Zach Plata Date: Mon, 24 Apr 2023 10:13:06 -0500 Subject: [PATCH] Add prop to the standalone Rive component --- src/components/Rive.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/Rive.tsx b/src/components/Rive.tsx index a774227..0c0c55c 100644 --- a/src/components/Rive.tsx +++ b/src/components/Rive.tsx @@ -28,7 +28,11 @@ export interface RiveProps { * For `@rive-app/react-webgl`, sets this property to maintain a single WebGL context for multiple canvases. **We recommend to keep the default value** when rendering multiple Rive instances on a page. */ useOffscreenRenderer?: boolean; -}; + /** + * Specify whether to disable Rive listeners on the canvas, thus preventing any event listeners to be attached to the canvas element + */ + shouldDisableRiveListeners?: boolean; +} const Rive = ({ src, @@ -37,6 +41,7 @@ const Rive = ({ stateMachines, layout, useOffscreenRenderer = true, + shouldDisableRiveListeners = false, ...rest }: RiveProps & ComponentProps<'canvas'>) => { const params = { @@ -46,6 +51,7 @@ const Rive = ({ layout, stateMachines, autoplay: true, + shouldDisableRiveListeners, }; const options = {