newshouldResizeCanvasToContainer optional option added to useRive options
Organizing hooks
Currently, the resizing logic for scaling the canvas with its parent container size is encapsulated in the useRive hook. This change would allow that utility logic to be broken out into its own hook (exportable from this runtime package) for folks that are looking to use this logic with perhaps the plain JS runtime (in a React component), or consumers using the low-level JS runtime that need this kind of utility.
Also adding an optional shouldResizeCanvasToContainer flag in options (defaulted to true) to allow users to specify whether they want the canvas to use the resizing logic we have on the canvas. Useful if folks want to resize according to their own logic
This change also moves out all other hooks baked into our utils.ts file into their own hook files so things are a little more organized in source.
useResizeCanvas
hook exportedshouldResizeCanvasToContainer
optional option added touseRive
optionsCurrently, the resizing logic for scaling the canvas with its parent container size is encapsulated in the
useRive
hook. This change would allow that utility logic to be broken out into its own hook (exportable from this runtime package) for folks that are looking to use this logic with perhaps the plain JS runtime (in a React component), or consumers using the low-level JS runtime that need this kind of utility.Also adding an optional
shouldResizeCanvasToContainer
flag in options (defaulted to true) to allow users to specify whether they want the canvas to use the resizing logic we have on the canvas. Useful if folks want to resize according to their own logicThis change also moves out all other hooks baked into our
utils.ts
file into their own hook files so things are a little more organized in source.