mirror of
https://github.com/rive-app/rive-react.git
synced 2026-02-04 06:54:24 +08:00
Autoplay by default on Rive component
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rive-react",
|
||||
"version": "0.0.2",
|
||||
"version": "0.0.3",
|
||||
"description": "React wrapper around the rive-js library",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/types/index.d.ts",
|
||||
|
||||
@@ -5,9 +5,8 @@ import useRive from '../hooks/useRive';
|
||||
export type RiveProps = {
|
||||
src: string;
|
||||
artboard?: string;
|
||||
animations?: string;
|
||||
animations?: string | string[];
|
||||
layout?: Layout;
|
||||
autoplay?: boolean;
|
||||
};
|
||||
|
||||
const Rive = ({
|
||||
@@ -15,7 +14,6 @@ const Rive = ({
|
||||
artboard,
|
||||
animations,
|
||||
layout,
|
||||
autoplay,
|
||||
...rest
|
||||
}: RiveProps & ComponentProps<'div'>) => {
|
||||
const params = {
|
||||
@@ -23,7 +21,7 @@ const Rive = ({
|
||||
artboard,
|
||||
animations,
|
||||
layout,
|
||||
autoplay,
|
||||
autoplay: true,
|
||||
};
|
||||
|
||||
const { RiveComponent } = useRive(params);
|
||||
|
||||
Reference in New Issue
Block a user