mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-10 10:33:11 +03:00
- Patch @radix-ui/react-compose-refs@1.1.2: stabilize useComposedRefs to prevent infinite render loops from unstable ref callbacks https://github.com/radix-ui/primitives/issues/3799 - Patch @radix-ui/react-slot@1.2.4: use useComposedRefs hook in SlotClone instead of inline composeRefs to prevent re-render cycles https://github.com/radix-ui/primitives/pull/3804 - Patch react-use-websocket@4.8.1: remove flushSync wrappers that cause "Maximum update depth exceeded" with React 19 auto-batching https://github.com/facebook/react/issues/27613 - Add npm overrides to ensure single hoisted copies of compose-refs and react-slot across all Radix packages - Add postinstall script for patch-package - Remove leftover react-transition-group dependency
47 lines
2.4 KiB
Diff
47 lines
2.4 KiB
Diff
diff --git a/node_modules/@radix-ui/react-slot/dist/index.js b/node_modules/@radix-ui/react-slot/dist/index.js
|
|
index 3691205..3b62ea8 100644
|
|
--- a/node_modules/@radix-ui/react-slot/dist/index.js
|
|
+++ b/node_modules/@radix-ui/react-slot/dist/index.js
|
|
@@ -85,11 +85,12 @@ function createSlotClone(ownerName) {
|
|
if (isLazyComponent(children) && typeof use === "function") {
|
|
children = use(children._payload);
|
|
}
|
|
+ const childrenRef = React.isValidElement(children) ? getElementRef(children) : null;
|
|
+ const composedRef = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, childrenRef);
|
|
if (React.isValidElement(children)) {
|
|
- const childrenRef = getElementRef(children);
|
|
const props2 = mergeProps(slotProps, children.props);
|
|
if (children.type !== React.Fragment) {
|
|
- props2.ref = forwardedRef ? (0, import_react_compose_refs.composeRefs)(forwardedRef, childrenRef) : childrenRef;
|
|
+ props2.ref = forwardedRef ? composedRef : childrenRef;
|
|
}
|
|
return React.cloneElement(children, props2);
|
|
}
|
|
diff --git a/node_modules/@radix-ui/react-slot/dist/index.mjs b/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
index d7ea374..a990150 100644
|
|
--- a/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
+++ b/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
@@ -1,6 +1,6 @@
|
|
// src/slot.tsx
|
|
import * as React from "react";
|
|
-import { composeRefs } from "@radix-ui/react-compose-refs";
|
|
+import { composeRefs, useComposedRefs } from "@radix-ui/react-compose-refs";
|
|
import { Fragment as Fragment2, jsx } from "react/jsx-runtime";
|
|
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
var use = React[" use ".trim().toString()];
|
|
@@ -45,11 +45,12 @@ function createSlotClone(ownerName) {
|
|
if (isLazyComponent(children) && typeof use === "function") {
|
|
children = use(children._payload);
|
|
}
|
|
+ const childrenRef = React.isValidElement(children) ? getElementRef(children) : null;
|
|
+ const composedRef = useComposedRefs(forwardedRef, childrenRef);
|
|
if (React.isValidElement(children)) {
|
|
- const childrenRef = getElementRef(children);
|
|
const props2 = mergeProps(slotProps, children.props);
|
|
if (children.type !== React.Fragment) {
|
|
- props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
+ props2.ref = forwardedRef ? composedRef : childrenRef;
|
|
}
|
|
return React.cloneElement(children, props2);
|
|
}
|