@primer/react 0.0.0-20260220145222 → 0.0.0-20260220162457
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/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
# @primer/react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-20260220162457
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- Fake entry to force publishing
|
|
8
8
|
|
|
9
|
+
- [#7553](https://github.com/primer/react/pull/7553) [`82ec766`](https://github.com/primer/react/commit/82ec76665b5aaf6ff46404e5930f68013049b2ba) Thanks [@hectahertz](https://github.com/hectahertz)! - perf(useRefObjectAsForwardedRef): add dependency array to useImperativeHandle
|
|
10
|
+
|
|
9
11
|
## 38.13.0
|
|
10
12
|
|
|
11
13
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRefObjectAsForwardedRef.d.ts","sourceRoot":"","sources":["../../src/hooks/useRefObjectAsForwardedRef.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAE,SAAS,EAAC,MAAM,OAAO,CAAA;AAGlD;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"useRefObjectAsForwardedRef.d.ts","sourceRoot":"","sources":["../../src/hooks/useRefObjectAsForwardedRef.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAE,SAAS,EAAC,MAAM,OAAO,CAAA;AAGlD;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAIjH"}
|
|
@@ -9,7 +9,7 @@ import { useImperativeHandle } from 'react';
|
|
|
9
9
|
* **NOTE**: The `refObject` should be passed to the underlying element, NOT the `forwardedRef`.
|
|
10
10
|
*/
|
|
11
11
|
function useRefObjectAsForwardedRef(forwardedRef, refObject) {
|
|
12
|
-
const $ = c(
|
|
12
|
+
const $ = c(4);
|
|
13
13
|
let t0;
|
|
14
14
|
if ($[0] !== refObject.current) {
|
|
15
15
|
t0 = () => refObject.current;
|
|
@@ -18,7 +18,15 @@ function useRefObjectAsForwardedRef(forwardedRef, refObject) {
|
|
|
18
18
|
} else {
|
|
19
19
|
t0 = $[1];
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
let t1;
|
|
22
|
+
if ($[2] !== refObject) {
|
|
23
|
+
t1 = [refObject];
|
|
24
|
+
$[2] = refObject;
|
|
25
|
+
$[3] = t1;
|
|
26
|
+
} else {
|
|
27
|
+
t1 = $[3];
|
|
28
|
+
}
|
|
29
|
+
useImperativeHandle(forwardedRef, t0, t1);
|
|
22
30
|
}
|
|
23
31
|
|
|
24
32
|
export { useRefObjectAsForwardedRef };
|
package/package.json
CHANGED