mirror of
https://github.com/rive-app/rive-react.git
synced 2026-03-13 08:22:30 +08:00
Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4914770c70 | ||
|
|
21e457bda4 | ||
|
|
cc0e91689b | ||
|
|
8244982000 | ||
|
|
439b413782 | ||
|
|
9ab4e378fc | ||
|
|
9061a93978 | ||
|
|
88d1bc000c | ||
|
|
9b1d3825f8 | ||
|
|
277f4d7db0 | ||
|
|
e68ca963a9 | ||
|
|
d820cdf6f1 | ||
|
|
c9a4dc0b5c | ||
|
|
19b58f5eb6 | ||
|
|
6263449898 | ||
|
|
630f70a81d | ||
|
|
bbd0d08fed | ||
|
|
ef23793d26 | ||
|
|
ca10584ed4 | ||
|
|
6fe765df84 | ||
|
|
c62b80af09 | ||
|
|
777337c481 | ||
|
|
da4b5978e7 | ||
|
|
09c0d1f947 | ||
|
|
0ca5933c41 | ||
|
|
f272fd92f0 | ||
|
|
192a562764 | ||
|
|
224a768737 | ||
|
|
c085bd5ea3 | ||
|
|
bb13c71982 | ||
|
|
779e06583c | ||
|
|
e172e0f210 | ||
|
|
abbcf14b70 | ||
|
|
a0885648ce | ||
|
|
9f768bdd0c |
120
CHANGELOG.md
120
CHANGELOG.md
@@ -4,8 +4,128 @@ All notable changes to this project will be documented in this file. Dates are d
|
||||
|
||||
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
||||
|
||||
#### [v4.18.8](https://github.com/rive-app/rive-react/compare/v4.18.7...v4.18.8)
|
||||
|
||||
- rive canvas 2.27.0 [`21e457b`](https://github.com/rive-app/rive-react/commit/21e457bda4bc3c09a0b866bcef062d8172d71105)
|
||||
|
||||
#### [v4.18.7](https://github.com/rive-app/rive-react/compare/v4.18.6...v4.18.7)
|
||||
|
||||
> 9 April 2025
|
||||
|
||||
- chore: release 4.18.7 [`cc0e916`](https://github.com/rive-app/rive-react/commit/cc0e91689b071569ae28728cc8dcab7e400926b3)
|
||||
- update to 2.26.8 [`8244982`](https://github.com/rive-app/rive-react/commit/82449820004e25b58684db5548183cde4eb59154)
|
||||
|
||||
#### [v4.18.6](https://github.com/rive-app/rive-react/compare/v4.18.5...v4.18.6)
|
||||
|
||||
> 3 April 2025
|
||||
|
||||
- chore: release 4.18.6 [`439b413`](https://github.com/rive-app/rive-react/commit/439b4137828b5be2f945e0f396309fadb78a27c7)
|
||||
- chore: bump rive web to 2.26.7 [`9ab4e37`](https://github.com/rive-app/rive-react/commit/9ab4e378fc31f462e7c4f3d5317e4ac631b2e386)
|
||||
|
||||
#### [v4.18.5](https://github.com/rive-app/rive-react/compare/v4.18.4...v4.18.5)
|
||||
|
||||
> 28 March 2025
|
||||
|
||||
- chore: release 4.18.5 [`9061a93`](https://github.com/rive-app/rive-react/commit/9061a93978cf482b25bdbedbbb053266687a9ee3)
|
||||
- update to 2.26.6 [`88d1bc0`](https://github.com/rive-app/rive-react/commit/88d1bc000cd5a8b20edf483a99c8c9b6b8ed28e4)
|
||||
|
||||
#### [v4.18.4](https://github.com/rive-app/rive-react/compare/v4.18.3...v4.18.4)
|
||||
|
||||
> 24 March 2025
|
||||
|
||||
- chore: release 4.18.4 [`9b1d382`](https://github.com/rive-app/rive-react/commit/9b1d3825f890bf8c82985073d50d67da95f9d727)
|
||||
- update rive canvas to 2.26.5 [`277f4d7`](https://github.com/rive-app/rive-react/commit/277f4d7db0ff0b873c2b10750affa97a9d29cbd3)
|
||||
|
||||
#### [v4.18.3](https://github.com/rive-app/rive-react/compare/v4.18.2...v4.18.3)
|
||||
|
||||
> 28 February 2025
|
||||
|
||||
- chore: release 4.18.3 [`e68ca96`](https://github.com/rive-app/rive-react/commit/e68ca963a93e779104c032ceb055c141f1a565eb)
|
||||
- update rive to 2.26.4 [`d820cdf`](https://github.com/rive-app/rive-react/commit/d820cdf6f13c53b519080ecd0438f222b9eda764)
|
||||
|
||||
#### [v4.18.2](https://github.com/rive-app/rive-react/compare/v4.18.1...v4.18.2)
|
||||
|
||||
> 17 February 2025
|
||||
|
||||
- chore: release 4.18.2 [`c9a4dc0`](https://github.com/rive-app/rive-react/commit/c9a4dc0b5cafd7696414ff99ae3add7bd852d0a7)
|
||||
- chore: update rive to 2.26.3 [`19b58f5`](https://github.com/rive-app/rive-react/commit/19b58f5eb6d215a92019b69d1c1a182e1b582af0)
|
||||
|
||||
#### [v4.18.1](https://github.com/rive-app/rive-react/compare/v4.18.0...v4.18.1)
|
||||
|
||||
> 15 February 2025
|
||||
|
||||
- chore: release 4.18.1 [`6263449`](https://github.com/rive-app/rive-react/commit/6263449898abdb77f4a08e92f186e61f9ec4cea8)
|
||||
- update rive to 2.26.2 [`630f70a`](https://github.com/rive-app/rive-react/commit/630f70a81dbf5292fc339163f3367b53adfb5e65)
|
||||
|
||||
#### [v4.18.0](https://github.com/rive-app/rive-react/compare/v4.17.10...v4.18.0)
|
||||
|
||||
> 11 February 2025
|
||||
|
||||
- chore: release 4.18.0 [`bbd0d08`](https://github.com/rive-app/rive-react/commit/bbd0d08fed0c3f3e5efd04f178e7a380951616ab)
|
||||
- cleanup instance if use effect reruns and instance is not loaded [`ca10584`](https://github.com/rive-app/rive-react/commit/ca10584ed422be62e9eea2b7d05007cd2abd3870)
|
||||
- update rive to 2.26.1 [`ef23793`](https://github.com/rive-app/rive-react/commit/ef23793d2629dee2eb448d0c825a3e7cdfb675d9)
|
||||
|
||||
#### [v4.17.10](https://github.com/rive-app/rive-react/compare/v4.17.9...v4.17.10)
|
||||
|
||||
> 27 January 2025
|
||||
|
||||
- chore: release 4.17.10 [`6fe765d`](https://github.com/rive-app/rive-react/commit/6fe765df84e996611b8878155ba0078ee9caff78)
|
||||
- chore: add React 19 support to package.json [`c62b80a`](https://github.com/rive-app/rive-react/commit/c62b80af09a3b42407dac8d9c63cd0e070738d82)
|
||||
|
||||
#### [v4.17.9](https://github.com/rive-app/rive-react/compare/v4.17.8...v4.17.9)
|
||||
|
||||
> 27 January 2025
|
||||
|
||||
- chore: release 4.17.9 [`777337c`](https://github.com/rive-app/rive-react/commit/777337c4814ecc16f09a7971f3fabccc4be48b33)
|
||||
- update rive to 2.25.7 [`da4b597`](https://github.com/rive-app/rive-react/commit/da4b5978e7a558bba0d10ca18ef3053deac88691)
|
||||
|
||||
#### [v4.17.8](https://github.com/rive-app/rive-react/compare/v4.17.7...v4.17.8)
|
||||
|
||||
> 24 January 2025
|
||||
|
||||
- chore: release 4.17.8 [`09c0d1f`](https://github.com/rive-app/rive-react/commit/09c0d1f94723f09faf06d0e17c19f322f0e2a1c2)
|
||||
- update rive to 2.25.6 [`0ca5933`](https://github.com/rive-app/rive-react/commit/0ca5933c411b1a733b35dd785a7bfcdba569b8c5)
|
||||
|
||||
#### [v4.17.7](https://github.com/rive-app/rive-react/compare/v4.17.6...v4.17.7)
|
||||
|
||||
> 23 January 2025
|
||||
|
||||
- chore: release 4.17.7 [`f272fd9`](https://github.com/rive-app/rive-react/commit/f272fd92f0030016b691923f8c61d1ae56182e82)
|
||||
- chore: bump wasm to 2.25.5 [`192a562`](https://github.com/rive-app/rive-react/commit/192a562764d1cb906d14e2f8f3d6fed3cfa5f039)
|
||||
|
||||
#### [v4.17.6](https://github.com/rive-app/rive-react/compare/v4.17.5...v4.17.6)
|
||||
|
||||
> 14 January 2025
|
||||
|
||||
- chore: release 4.17.6 [`224a768`](https://github.com/rive-app/rive-react/commit/224a7687373bfc8ef05bfb4604f5b1e2be9e4cdd)
|
||||
- update rive to 2.25.4 [`c085bd5`](https://github.com/rive-app/rive-react/commit/c085bd5ea3c811a5934c725d3347baf723b11225)
|
||||
|
||||
#### [v4.17.5](https://github.com/rive-app/rive-react/compare/v4.17.4...v4.17.5)
|
||||
|
||||
> 24 December 2024
|
||||
|
||||
- chore: release 4.17.5 [`bb13c71`](https://github.com/rive-app/rive-react/commit/bb13c719828b2c5c27b524f0e79b5f7ad3896618)
|
||||
- bump rive canvas to 2.25.3 [`779e065`](https://github.com/rive-app/rive-react/commit/779e06583ceb853621693d0e0c056537c90998b9)
|
||||
|
||||
#### [v4.17.4](https://github.com/rive-app/rive-react/compare/v4.17.3...v4.17.4)
|
||||
|
||||
> 17 December 2024
|
||||
|
||||
- chore: release 4.17.4 [`e172e0f`](https://github.com/rive-app/rive-react/commit/e172e0f21092a3c4dd9cf528aa71684dc07b3fa7)
|
||||
- rive canvas 2.25.2 [`abbcf14`](https://github.com/rive-app/rive-react/commit/abbcf14b706fedb8aed1c291b0d35b225206eed8)
|
||||
|
||||
#### [v4.17.3](https://github.com/rive-app/rive-react/compare/v4.17.2...v4.17.3)
|
||||
|
||||
> 13 December 2024
|
||||
|
||||
- chore: release 4.17.3 [`a088564`](https://github.com/rive-app/rive-react/commit/a0885648ceb4d833c1467fd10d36641fc5f79450)
|
||||
- rive canvas 2.25.1 [`9f768bd`](https://github.com/rive-app/rive-react/commit/9f768bdd0ca07aedec7f67405223b44bcf7380d7)
|
||||
|
||||
#### [v4.17.2](https://github.com/rive-app/rive-react/compare/v4.17.1...v4.17.2)
|
||||
|
||||
> 11 December 2024
|
||||
|
||||
- chore: release 4.17.2 [`94c9a2a`](https://github.com/rive-app/rive-react/commit/94c9a2a60b89244e0a36eb9324e500616a31e970)
|
||||
- rive canvas 2.25.0 [`dfe0d10`](https://github.com/rive-app/rive-react/commit/dfe0d109368abe8ebadf8dabc80d05116242c301)
|
||||
|
||||
#### [v4.17.1](https://github.com/rive-app/rive-react/compare/v4.17.0...v4.17.1)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@rive-app/react-canvas-lite",
|
||||
"version": "4.17.2",
|
||||
"version": "4.18.8",
|
||||
"description": "React wrapper around the @rive-app/canvas-lite library",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/types/index.d.ts",
|
||||
@@ -18,9 +18,9 @@
|
||||
},
|
||||
"homepage": "https://github.com/rive-app/rive-react#readme",
|
||||
"dependencies": {
|
||||
"@rive-app/canvas-lite": "2.25.0"
|
||||
"@rive-app/canvas-lite": "2.27.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@rive-app/react-canvas",
|
||||
"version": "4.17.2",
|
||||
"version": "4.18.8",
|
||||
"description": "React wrapper around the @rive-app/canvas library",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/types/index.d.ts",
|
||||
@@ -18,9 +18,9 @@
|
||||
},
|
||||
"homepage": "https://github.com/rive-app/rive-react#readme",
|
||||
"dependencies": {
|
||||
"@rive-app/canvas": "2.25.0"
|
||||
"@rive-app/canvas": "2.27.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@rive-app/react-webgl",
|
||||
"version": "4.17.2",
|
||||
"version": "4.18.8",
|
||||
"description": "React wrapper around the @rive-app/webgl library",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/types/index.d.ts",
|
||||
@@ -18,9 +18,9 @@
|
||||
},
|
||||
"homepage": "https://github.com/rive-app/rive-react#readme",
|
||||
"dependencies": {
|
||||
"@rive-app/webgl": "2.25.0"
|
||||
"@rive-app/webgl": "2.27.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@rive-app/react-webgl2",
|
||||
"version": "4.17.2",
|
||||
"version": "4.18.8",
|
||||
"description": "React wrapper around the @rive-app/webgl2 library",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/types/index.d.ts",
|
||||
@@ -18,9 +18,9 @@
|
||||
},
|
||||
"homepage": "https://github.com/rive-app/rive-react#readme",
|
||||
"dependencies": {
|
||||
"@rive-app/webgl2": "2.25.0"
|
||||
"@rive-app/webgl2": "2.27.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0"
|
||||
}
|
||||
}
|
||||
12
package.json
12
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rive-react",
|
||||
"version": "4.17.2",
|
||||
"version": "4.18.8",
|
||||
"description": "React wrapper around the rive-js library",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/types/index.d.ts",
|
||||
@@ -36,13 +36,13 @@
|
||||
},
|
||||
"homepage": "https://github.com/rive-app/rive-react#readme",
|
||||
"dependencies": {
|
||||
"@rive-app/canvas": "2.25.0",
|
||||
"@rive-app/canvas-lite": "2.25.0",
|
||||
"@rive-app/webgl": "2.25.0",
|
||||
"@rive-app/webgl2": "2.25.0"
|
||||
"@rive-app/canvas": "2.27.0",
|
||||
"@rive-app/canvas-lite": "2.27.0",
|
||||
"@rive-app/webgl": "2.27.0",
|
||||
"@rive-app/webgl2": "2.27.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.18.0",
|
||||
|
||||
@@ -126,24 +126,32 @@ export default function useRive(
|
||||
if (!canvasElem || !riveParams) {
|
||||
return;
|
||||
}
|
||||
let isLoaded = rive != null;
|
||||
let r: Rive | null;
|
||||
if (rive == null) {
|
||||
const { useOffscreenRenderer } = options;
|
||||
const r = new Rive({
|
||||
r = new Rive({
|
||||
useOffscreenRenderer,
|
||||
...riveParams,
|
||||
canvas: canvasElem,
|
||||
});
|
||||
r.on(EventType.Load, () => {
|
||||
isLoaded = true;
|
||||
// Check if the component/canvas is mounted before setting state to avoid setState
|
||||
// on an unmounted component in some rare cases
|
||||
if (canvasElem) {
|
||||
setRive(r);
|
||||
} else {
|
||||
// If unmounted, cleanup the rive object immediately
|
||||
r.cleanup();
|
||||
r!.cleanup();
|
||||
}
|
||||
});
|
||||
}
|
||||
return () => {
|
||||
if(!isLoaded) {
|
||||
r?.cleanup();
|
||||
}
|
||||
}
|
||||
}, [canvasElem, isParamsLoaded, rive]);
|
||||
/**
|
||||
* Ref callback called when the container element mounts
|
||||
|
||||
Reference in New Issue
Block a user