mirror of
https://github.com/rive-app/rive-react.git
synced 2026-03-13 08:22:30 +08:00
Feat: Bump wasm and add examples to support touch feature
This commit is contained in:
committed by
Zachary Plata
parent
21a17ed40e
commit
3902948a2e
@@ -6,10 +6,10 @@
|
||||
"@testing-library/jest-dom": "^5.13.0",
|
||||
"@testing-library/react": "^11.2.7",
|
||||
"@testing-library/user-event": "^12.8.3",
|
||||
"react": "^17.0.2",
|
||||
"react": "file:../../node_modules/react",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-scripts": "4.0.3",
|
||||
"rive-react": "latest",
|
||||
"rive-react": "file:../..",
|
||||
"web-vitals": "^1.1.2"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
BIN
examples/basic-with-hook/public/magic-ball.riv
Normal file
BIN
examples/basic-with-hook/public/magic-ball.riv
Normal file
Binary file not shown.
@@ -6,13 +6,23 @@ function App() {
|
||||
autoplay: true,
|
||||
};
|
||||
|
||||
const { RiveComponent } = useRive(params);
|
||||
const { RiveComponent: RiveComponentBasic } = useRive(params);
|
||||
|
||||
const { RiveComponent: RiveComponentTouch } = useRive({
|
||||
src: 'magic-ball.riv',
|
||||
autoplay: true,
|
||||
stateMachines: "Main State Machine",
|
||||
});
|
||||
|
||||
return (
|
||||
// The animation will fit to the parent element.
|
||||
<div style={{ height: '500px', width: '500px' }}>
|
||||
<RiveComponent />
|
||||
</div>
|
||||
<>
|
||||
<div style={{ height: '500px', width: '500px' }}>
|
||||
<RiveComponentBasic />
|
||||
</div>
|
||||
<div style={{ height: '300px', width: '300px' }}>
|
||||
<RiveComponentTouch />
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
},
|
||||
"homepage": "https://github.com/rive-app/rive-react#readme",
|
||||
"dependencies": {
|
||||
"@rive-app/canvas": "1.0.59",
|
||||
"@rive-app/webgl": "1.0.56"
|
||||
"@rive-app/canvas": "1.0.60",
|
||||
"@rive-app/webgl": "1.0.57"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
|
||||
Reference in New Issue
Block a user