Skip to content

Commit 1d78fd5

Browse files
perf(web): the expanded image dialog compiles without manual memoization
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent a702563 commit 1d78fd5

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

‎apps/web/src/components/chat/ExpandedImageDialog.tsx‎

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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";
102
import { ChevronLeftIcon, ChevronRightIcon, XIcon } from "lucide-react";
113
import { Image as ImageGlyph, Text as TextGlyph } from "lucide";
124
import { Button } from "../ui/button";
@@ -102,9 +94,9 @@ export const ExpandedImageDialog = memo(function ExpandedImageDialog({
10294
}
10395
: source;
10496

105-
const navigateImage = useCallback((direction: -1 | 1) => {
97+
const navigateImage = (direction: -1 | 1) => {
10698
setImageOffset((current) => current + direction);
107-
}, []);
99+
};
108100

109101
// The element that opened the preview gets focus back on close. Without
110102
// this a close button click leaves focus on the unmounted dialog, and the

0 commit comments

Comments
 (0)