mirror of
https://github.com/rive-app/rive-react.git
synced 2026-03-13 08:22:30 +08:00
Also export the container ref current element
This commit is contained in:
committed by
Zachary Plata
parent
a24b910096
commit
08b9f9a2aa
@@ -199,6 +199,7 @@ export default function useRive(
|
||||
|
||||
return {
|
||||
canvas: canvasRef.current,
|
||||
container: containerRef.current,
|
||||
setCanvasRef,
|
||||
setContainerRef,
|
||||
rive,
|
||||
|
||||
@@ -18,6 +18,7 @@ export type Dimensions = {
|
||||
/**
|
||||
* @typedef RiveState
|
||||
* @property canvas - Canvas element the Rive Animation is attached to.
|
||||
* @property container - Container element of the canvas.
|
||||
* @property setCanvasRef - Ref callback to be passed to the canvas element.
|
||||
* @property setContainerRef - Ref callback to be passed to the container element
|
||||
* of the canvas. This is optional, however if not used then the hook will
|
||||
@@ -27,6 +28,7 @@ export type Dimensions = {
|
||||
*/
|
||||
export type RiveState = {
|
||||
canvas: HTMLCanvasElement | null;
|
||||
container: HTMLElement | null;
|
||||
setCanvasRef: RefCallback<HTMLCanvasElement>;
|
||||
setContainerRef: RefCallback<HTMLElement>;
|
||||
rive: Rive | null;
|
||||
|
||||
Reference in New Issue
Block a user