You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> 💡 By default, the hook will be updated when options changed (i.e. keyframes, animationOptions etc.). However, you can disable this behavior by setting the `shouldUpdateAnimation` option to `false`.
133
+
132
134
### Playback Control
133
135
134
136
The shortcoming with existing technologies was the lack of playback control. The Web Animations API provides several useful methods for controlling playback: play, pause, reverse, cancel, finish, seek, control speed via the [methods](https://developer.mozilla.org/en-US/docs/Web/API/Animation#Methods) of the **Animation** interface. This hook exposes the animation instance for us to interact with animations, we can access it by the `getAnimation()` return value.
@@ -532,17 +534,18 @@ It's returned with the following properties.
532
534
533
535
The `options` provides the following configurations and event callbacks for you.
|`ref`| object || For [some reasons](#use-your-own-ref), you can pass in your own ref instead of using the built-in. |
538
-
|`id`| string |`""`| Sets the ID of an animation, implemented based on the [Animation.id](https://developer.mozilla.org/en-US/docs/Web/API/Animation/id). |
539
-
|`playbackRate`| number |`1`| Sets the playback rate of an animation, implemented based on the [Animation.playbackRate](https://developer.mozilla.org/en-US/docs/Web/API/Animation/playbackRate). |
540
-
|`autoPlay`| boolean |`true`| Automatically starts the animation. |
541
-
|`keyframes`| Array \| object || An array of keyframe objects, or a keyframe object whose property are arrays of values to iterate over. See [basic usage](#basic-usage) for more details. |
542
-
|`animationOptions`| number \| object || An **integer** representing the animation's duration (in milliseconds), or an **object** containing one or more timing properties. See [basic usage](#basic-usage) for more details. |
543
-
|`onReady`| function || It's invoked when an animation is ready to play. You can access the [playState](#basic-usage), [animate](#dynamic-interactions-with-animation) and [animation](#getting-animations-information) from the event object. |
544
-
|`onUpdate`| function || It's invoked when an animation enters the `running` state or changes state. You can access the [playState](#basic-usage), [animate](#dynamic-interactions-with-animation) and [animation](#getting-animations-information) from the event object. |
545
-
|`onFinish`| function || It's invoked when an animation enters the `finished` state. You can access the [playState](#basic-usage), [animate](#dynamic-interactions-with-animation) and [animation](#getting-animations-information) from the event object. |
|`ref`| object || For [some reasons](#use-your-own-ref), you can pass in your own ref instead of using the built-in. |
540
+
|`id`| string |`""`| Sets the ID of an animation, implemented based on the [Animation.id](https://developer.mozilla.org/en-US/docs/Web/API/Animation/id). |
541
+
|`playbackRate`| number |`1`| Sets the playback rate of an animation, implemented based on the [Animation.playbackRate](https://developer.mozilla.org/en-US/docs/Web/API/Animation/playbackRate). |
542
+
|`autoPlay`| boolean |`true`| Automatically starts the animation. |
543
+
|`keyframes`| Array \| object || An array of keyframe objects, or a keyframe object whose property are arrays of values to iterate over. See [basic usage](#basic-usage) for more details. |
544
+
|`animationOptions`| number \| object || An **integer** representing the animation's duration (in milliseconds), or an **object** containing one or more timing properties. See [basic usage](#basic-usage) for more details. |
545
+
|`shouldUpdateAnimation`| boolean |`true`| By default, the hook will be updated when options changed (i.e. keyframes, animationOptions etc.). However, you can disable this behavior by setting this option to `false`. |
546
+
|`onReady`| function || It's invoked when an animation is ready to play. You can access the [playState](#basic-usage), [animate](#dynamic-interactions-with-animation) and [animation](#getting-animations-information) from the event object. |
547
+
|`onUpdate`| function || It's invoked when an animation enters the `running` state or changes state. You can access the [playState](#basic-usage), [animate](#dynamic-interactions-with-animation) and [animation](#getting-animations-information) from the event object. |
548
+
|`onFinish`| function || It's invoked when an animation enters the `finished` state. You can access the [playState](#basic-usage), [animate](#dynamic-interactions-with-animation) and [animation](#getting-animations-information) from the event object. |
0 commit comments