@depup/lottie-react 3.1.0-depup.0 → 3.1.1-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/build/utils/mergeRefs.cjs +14 -8
- package/build/utils/mergeRefs.js +14 -8
- package/changes.json +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -13,8 +13,8 @@ npm install @depup/lottie-react
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [lottie-react](https://www.npmjs.com/package/lottie-react) @ 3.1.
|
|
17
|
-
| Processed | 2026-08-
|
|
16
|
+
| Original | [lottie-react](https://www.npmjs.com/package/lottie-react) @ 3.1.1 |
|
|
17
|
+
| Processed | 2026-08-27 |
|
|
18
18
|
| Smoke test | passed |
|
|
19
19
|
| Deps updated | 0 |
|
|
20
20
|
|
|
@@ -5,20 +5,25 @@
|
|
|
5
5
|
* An element has a single `ref` slot, so any element that both this library and
|
|
6
6
|
* the person using it want a handle on needs one callback that feeds both.
|
|
7
7
|
*
|
|
8
|
-
* Teardown is the
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* callback with `null
|
|
8
|
+
* Teardown is where the two supported React versions differ. React 19 treats a
|
|
9
|
+
* function returned from a ref callback as its cleanup and never calls that ref
|
|
10
|
+
* with `null`; React 18 always calls with `null` and, in development, reports a
|
|
11
|
+
* returned function. So a combined teardown is returned only when a ref returned
|
|
12
|
+
* a cleanup of its own, since that ref must be torn down by it rather than by a
|
|
13
|
+
* `null` call. Otherwise nothing is returned and both versions call this
|
|
14
|
+
* callback with `null`, which clears every ref.
|
|
15
15
|
*/
|
|
16
16
|
function mergeRefs(...refs) {
|
|
17
17
|
return (node) => {
|
|
18
|
+
let returned = false;
|
|
18
19
|
const teardowns = refs.map((ref) => {
|
|
19
20
|
if (typeof ref === "function") {
|
|
20
21
|
const cleanup = ref(node);
|
|
21
|
-
|
|
22
|
+
if (typeof cleanup === "function") {
|
|
23
|
+
returned = true;
|
|
24
|
+
return cleanup;
|
|
25
|
+
}
|
|
26
|
+
return () => ref(null);
|
|
22
27
|
}
|
|
23
28
|
if (ref) {
|
|
24
29
|
ref.current = node;
|
|
@@ -28,6 +33,7 @@ function mergeRefs(...refs) {
|
|
|
28
33
|
}
|
|
29
34
|
return () => void 0;
|
|
30
35
|
});
|
|
36
|
+
if (!returned) return;
|
|
31
37
|
return () => {
|
|
32
38
|
for (const teardown of teardowns) teardown();
|
|
33
39
|
};
|
package/build/utils/mergeRefs.js
CHANGED
|
@@ -5,20 +5,25 @@
|
|
|
5
5
|
* An element has a single `ref` slot, so any element that both this library and
|
|
6
6
|
* the person using it want a handle on needs one callback that feeds both.
|
|
7
7
|
*
|
|
8
|
-
* Teardown is the
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* callback with `null
|
|
8
|
+
* Teardown is where the two supported React versions differ. React 19 treats a
|
|
9
|
+
* function returned from a ref callback as its cleanup and never calls that ref
|
|
10
|
+
* with `null`; React 18 always calls with `null` and, in development, reports a
|
|
11
|
+
* returned function. So a combined teardown is returned only when a ref returned
|
|
12
|
+
* a cleanup of its own, since that ref must be torn down by it rather than by a
|
|
13
|
+
* `null` call. Otherwise nothing is returned and both versions call this
|
|
14
|
+
* callback with `null`, which clears every ref.
|
|
15
15
|
*/
|
|
16
16
|
function mergeRefs(...refs) {
|
|
17
17
|
return (node) => {
|
|
18
|
+
let returned = false;
|
|
18
19
|
const teardowns = refs.map((ref) => {
|
|
19
20
|
if (typeof ref === "function") {
|
|
20
21
|
const cleanup = ref(node);
|
|
21
|
-
|
|
22
|
+
if (typeof cleanup === "function") {
|
|
23
|
+
returned = true;
|
|
24
|
+
return cleanup;
|
|
25
|
+
}
|
|
26
|
+
return () => ref(null);
|
|
22
27
|
}
|
|
23
28
|
if (ref) {
|
|
24
29
|
ref.current = node;
|
|
@@ -28,6 +33,7 @@ function mergeRefs(...refs) {
|
|
|
28
33
|
}
|
|
29
34
|
return () => void 0;
|
|
30
35
|
});
|
|
36
|
+
if (!returned) return;
|
|
31
37
|
return () => {
|
|
32
38
|
for (const teardown of teardowns) teardown();
|
|
33
39
|
};
|
package/changes.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/lottie-react",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.1-depup.0",
|
|
4
4
|
"description": "Lottie animations in React: one component for the easy path, the whole engine when you need control. (with updated dependencies)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lottie-react",
|
|
@@ -174,8 +174,8 @@
|
|
|
174
174
|
"changes": {},
|
|
175
175
|
"depsUpdated": 0,
|
|
176
176
|
"originalPackage": "lottie-react",
|
|
177
|
-
"originalVersion": "3.1.
|
|
178
|
-
"processedAt": "2026-08-
|
|
177
|
+
"originalVersion": "3.1.1",
|
|
178
|
+
"processedAt": "2026-08-27T19:34:01.227Z",
|
|
179
179
|
"smokeTest": "passed"
|
|
180
180
|
}
|
|
181
181
|
}
|