Skip to content

Commit 4d8039b

Browse files
fix: patch react-window-splitter to suppress hydration warning on resize handles
Co-Authored-By: Eric Allam <eallam@icloud.com>
1 parent 8627b55 commit 4d8039b

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@
8383
"@sentry/remix@9.46.0": "patches/@sentry__remix@9.46.0.patch",
8484
"@upstash/ratelimit@1.1.3": "patches/@upstash__ratelimit.patch",
8585
"antlr4ts@0.5.0-alpha.4": "patches/antlr4ts@0.5.0-alpha.4.patch",
86-
"@window-splitter/state@0.4.1": "patches/@window-splitter__state@0.4.1.patch"
86+
"@window-splitter/state@0.4.1": "patches/@window-splitter__state@0.4.1.patch",
87+
"react-window-splitter@0.4.1": "patches/react-window-splitter@0.4.1.patch"
8788
},
8889
"overrides": {
8990
"typescript": "5.5.4",
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
diff --git a/dist/commonjs/index.js b/dist/commonjs/index.js
2+
index 1f4ff1a53983a76140f6349c8ef9b91ca9eee6ef..a193ecbf5257e5bdc8524e7b75a23c0bcb19b179 100644
3+
--- a/dist/commonjs/index.js
4+
+++ b/dist/commonjs/index.js
5+
@@ -469,7 +469,7 @@ const PanelResizerVisible = react_1.default.forwardRef(function PanelResizerVisi
6+
if (!panelBeforeHandle || !(0, state_1.isPanelData)(panelBeforeHandle)) {
7+
return null;
8+
}
9+
- return (react_1.default.createElement("div", { ref: ref, role: "separator", "data-splitter-type": "handle", "data-splitter-id": handleId, "data-handle-orientation": orientation, "data-state": isDragging ? "dragging" : "idle", "aria-label": "Resize Handle", "aria-disabled": disabled, "aria-controls": panelBeforeHandle.id, "aria-valuemin": (0, state_1.getUnitPercentageValue)(groupsSize, panelBeforeHandle.min), "aria-valuemax": panelBeforeHandle.max === "1fr"
10+
+ return (react_1.default.createElement("div", { ref: ref, role: "separator", suppressHydrationWarning: true, "data-splitter-type": "handle", "data-splitter-id": handleId, "data-handle-orientation": orientation, "data-state": isDragging ? "dragging" : "idle", "aria-label": "Resize Handle", "aria-disabled": disabled, "aria-controls": panelBeforeHandle.id, "aria-valuemin": (0, state_1.getUnitPercentageValue)(groupsSize, panelBeforeHandle.min), "aria-valuemax": panelBeforeHandle.max === "1fr"
11+
? 100
12+
: (0, state_1.getUnitPercentageValue)(groupsSize, panelBeforeHandle.max), "aria-valuenow": (0, state_1.getUnitPercentageValue)(groupsSize, panelBeforeHandle.currentValue), ...(0, react_aria_1.mergeProps)(props, disabled ? {} : buttonProps, disabled ? {} : moveProps, { onKeyDown }), tabIndex: 0, style: {
13+
cursor,
14+
diff --git a/dist/esm/index.js b/dist/esm/index.js
15+
index 0102166ddd34988ec06d1991290dcf8d748a44cd..10e320df665c27e1b4cce4a6a6f47dd505d0c5a6 100644
16+
--- a/dist/esm/index.js
17+
+++ b/dist/esm/index.js
18+
@@ -440,7 +440,7 @@ const PanelResizerVisible = React.forwardRef(function PanelResizerVisible({ size
19+
if (!panelBeforeHandle || !isPanelData(panelBeforeHandle)) {
20+
return null;
21+
}
22+
- return (React.createElement("div", { ref: ref, role: "separator", "data-splitter-type": "handle", "data-splitter-id": handleId, "data-handle-orientation": orientation, "data-state": isDragging ? "dragging" : "idle", "aria-label": "Resize Handle", "aria-disabled": disabled, "aria-controls": panelBeforeHandle.id, "aria-valuemin": getUnitPercentageValue(groupsSize, panelBeforeHandle.min), "aria-valuemax": panelBeforeHandle.max === "1fr"
23+
+ return (React.createElement("div", { ref: ref, role: "separator", suppressHydrationWarning: true, "data-splitter-type": "handle", "data-splitter-id": handleId, "data-handle-orientation": orientation, "data-state": isDragging ? "dragging" : "idle", "aria-label": "Resize Handle", "aria-disabled": disabled, "aria-controls": panelBeforeHandle.id, "aria-valuemin": getUnitPercentageValue(groupsSize, panelBeforeHandle.min), "aria-valuemax": panelBeforeHandle.max === "1fr"
24+
? 100
25+
: getUnitPercentageValue(groupsSize, panelBeforeHandle.max), "aria-valuenow": getUnitPercentageValue(groupsSize, panelBeforeHandle.currentValue), ...mergeProps(props, disabled ? {} : buttonProps, disabled ? {} : moveProps, { onKeyDown }), tabIndex: 0, style: {
26+
cursor,
27+
diff --git a/src/index.tsx b/src/index.tsx
28+
index c00b560a0a19759ee6e32c0bd42b105d28ec41fc..ea14614d97f9e30c36131537dbb73192e047dc79 100644
29+
--- a/src/index.tsx
30+
+++ b/src/index.tsx
31+
@@ -805,6 +805,7 @@ const PanelResizerVisible = React.forwardRef<
32+
<div
33+
ref={ref as unknown as React.Ref<HTMLDivElement>}
34+
role="separator"
35+
+ suppressHydrationWarning
36+
data-splitter-type="handle"
37+
data-splitter-id={handleId}
38+
data-handle-orientation={orientation}

0 commit comments

Comments
 (0)