The best way to control Claude Code, Codex and more from any computer or phone
perf(web): the zoomable image compiles without manual memoization (#20549)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 16, 2026 at 22:08 UTC
687f1e94872e7b7191355a536aac3f3070379f1c
1 file changed
+3
-11
apps/web/src/components/chat/ZoomableImage.tsx
+3
-11
@@ -1,12 +1,4 @@
1
-import {
2
- useCallback,
3
- useEffect,
4
- useImperativeHandle,
5
- useLayoutEffect,
6
- useRef,
7
- useState,
8
- type Ref,
9
-} from "react";
1
+import { useEffect, useImperativeHandle, useLayoutEffect, useRef, useState, type Ref } from "react";
2
3
const MAX_ZOOM = 8;
4
@@ -86,7 +78,7 @@ export function ZoomableImage({
78
[],
79
);
80
89
- const changeZoom = useCallback((next: number, point?: { x: number; y: number }) => {
81
+ const changeZoom = (next: number, point?: { x: number; y: number }) => {
82
const viewport = viewportRef.current;
83
const previous = zoomRef.current;
84
const clamped = Math.min(MAX_ZOOM, Math.max(1, next));
@@ -102,7 +94,7 @@ export function ZoomableImage({
94
};
95
zoomRef.current = clamped;
96
setZoom(clamped);
105
- }, []);
97
+ };
98
99
useLayoutEffect(() => {
100
const viewport = viewportRef.current;