The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 23, 06:45 UTC
perf(web): useResizableWidth compiles without manual memoization (#20653)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 16, 2026 at 21:57 UTC
d42681d06ff6417f510a4fe70d31cc7739a3fe8b
1 file changed
+5
-14
apps/web/src/hooks/useResizableWidth.ts
+5
-14
@@ -1,11 +1,5 @@
1
import * as Schema from "effect/Schema";
2
-import {
3
- type PointerEvent as ReactPointerEvent,
4
- useCallback,
5
- useLayoutEffect,
6
- useRef,
7
- useState,
8
-} from "react";
2
+import { type PointerEvent as ReactPointerEvent, useLayoutEffect, useRef, useState } from "react";
3
4
import { getLocalStorageItem, setLocalStorageItem } from "./useLocalStorage";
5
import { useResizeDrag } from "./useResizeDrag";
@@ -43,13 +37,10 @@ export function useResizableWidth(options: UseResizableWidthOptions): {
37
} {
38
const { storageKey, defaultWidth, minWidth, maxWidth, edge } = options;
39
46
- const clamp = useCallback(
47
- (value: number): number => {
48
- if (!Number.isFinite(value)) return defaultWidth;
49
- return Math.max(minWidth, Math.min(maxWidth, value));
50
- },
51
- [defaultWidth, maxWidth, minWidth],
52
- );
40
+ const clamp = (value: number): number => {
41
+ if (!Number.isFinite(value)) return defaultWidth;
42
+ return Math.max(minWidth, Math.min(maxWidth, value));
43
+ };
44
45
const readWidth = () => {
46
if (typeof window === "undefined") return defaultWidth;