diff --git a/src/hooks/useRive.tsx b/src/hooks/useRive.tsx index 7ab3694..b2dfd5f 100644 --- a/src/hooks/useRive.tsx +++ b/src/hooks/useRive.tsx @@ -83,7 +83,7 @@ export default function useRive( */ const onCanvasHasResized = useCallback(() => { if (rive) { - if (rive.layout.fit === Fit.Layout) { + if (rive.layout && rive.layout.fit === Fit.Layout) { if (canvasElem) { // TODO (Gordon): expose these are properties on JS runtime (rive as any)._devicePixelRatioUsed = devicePixelRatio;