The best way to control Claude Code, Codex and more from any computer or phone
perf(web): the expanded image dialog compiles without manual memoization (#20672)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 16, 2026 at 21:54 UTC
92b896710b43e4e4f0a3cec73eb246658979a102
1 file changed
+3
-11
apps/web/src/components/chat/ExpandedImageDialog.tsx
+3
-11
@@ -1,12 +1,4 @@
1
-import {
2
- memo,
3
- useCallback,
4
- useEffect,
5
- useRef,
6
- useState,
7
- type ReactNode,
8
- type KeyboardEvent,
9
-} from "react";
1
+import { memo, useEffect, useRef, useState, type ReactNode, type KeyboardEvent } from "react";
2
import { ChevronLeftIcon, ChevronRightIcon, XIcon } from "lucide-react";
3
import { Image as ImageGlyph, Text as TextGlyph } from "lucide";
4
import { Button } from "../ui/button";
@@ -102,9 +94,9 @@ export const ExpandedImageDialog = memo(function ExpandedImageDialog({
94
}
95
: source;
96
105
- const navigateImage = useCallback((direction: -1 | 1) => {
97
+ const navigateImage = (direction: -1 | 1) => {
98
setImageOffset((current) => current + direction);
107
- }, []);
99
+ };
100
101
// The element that opened the preview gets focus back on close. Without
102
// this a close button click leaves focus on the unmounted dialog, and the