Skip to content

Commit

Permalink
runfix: conversation component infinite rerender (#14314)
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrykBuniX authored Dec 13, 2022
1 parent de0180a commit 09eb03b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/script/components/Conversation/Conversation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -482,10 +482,13 @@ export const Conversation: FC<ConversationProps> = ({
};
};

const wrapperRefHandler = (element: HTMLElement | null) => {
removeAnimationsClass(element);
handleFileDrop(element);
};
const wrapperRefHandler = useCallback(
(element: HTMLElement | null) => {
removeAnimationsClass(element);
handleFileDrop(element);
},
[handleFileDrop],
);

return (
<div
Expand Down

0 comments on commit 09eb03b

Please sign in to comment.