Skip to content

Commit e1b75e5

Browse files
committed
chore: useCallback in titlebar.view
1 parent 2133de9 commit e1b75e5

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

packages/main-layout/src/browser/accordion/titlebar.view.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,14 @@ export const TitleBar: React.FC<{
1717
const styles_titlebar = useDesignStyles(styles.titlebar, 'titlebar');
1818
const tabbarService: TabbarService = useInjectable(TabbarServiceFactory)(props.side);
1919

20-
const handleDragStart = (e: React.DragEvent) => {
21-
if (props.containerId && props.side) {
22-
tabbarService.handleDragStart(e, props.containerId);
23-
}
24-
};
20+
const handleDragStart = React.useCallback(
21+
(e: React.DragEvent) => {
22+
if (props.containerId && props.side) {
23+
tabbarService.handleDragStart(e, props.containerId);
24+
}
25+
},
26+
[props.containerId, props.side, tabbarService],
27+
);
2528

2629
const handleDragEnd = React.useCallback(
2730
(e: React.DragEvent) => {

0 commit comments

Comments
 (0)