diff --git a/package.json b/package.json index 5a3fdae..cdfb52d 100644 --- a/package.json +++ b/package.json @@ -36,10 +36,10 @@ }, "homepage": "https://github.com/rive-app/rive-react#readme", "dependencies": { - "@rive-app/canvas": "2.23.0", - "@rive-app/canvas-lite": "2.23.0", - "@rive-app/webgl": "2.23.0", - "@rive-app/webgl2": "2.23.0" + "@rive-app/canvas": "2.23.1", + "@rive-app/canvas-lite": "2.23.1", + "@rive-app/webgl": "2.23.1", + "@rive-app/webgl2": "2.23.1" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0" diff --git a/src/hooks/useRive.tsx b/src/hooks/useRive.tsx index e430fc5..70f4af3 100644 --- a/src/hooks/useRive.tsx +++ b/src/hooks/useRive.tsx @@ -86,10 +86,9 @@ export default function useRive( if (rive.layout && rive.layout.fit === Fit.Layout) { if (canvasElem) { const resizeFactor = devicePixelRatio * rive.layout.layoutScaleFactor; - // TODO (Gordon): expose these are properties on JS runtime - (rive as any)._devicePixelRatioUsed = devicePixelRatio; - (rive as any).artboard.width = canvasElem?.width / resizeFactor; - (rive as any).artboard.height = canvasElem?.height / resizeFactor; + rive.devicePixelRatioUsed = devicePixelRatio; + rive.artboardWidth = canvasElem?.width / resizeFactor; + rive.artboardHeight = canvasElem?.height / resizeFactor; } }