diff --git a/src/components/Composer/index.tsx b/src/components/Composer/index.tsx index a41f983434d8..3889c8597843 100755 --- a/src/components/Composer/index.tsx +++ b/src/components/Composer/index.tsx @@ -116,12 +116,11 @@ function Composer( }, [shouldClear, onClear]); useEffect(() => { - setSelection((prevSelection) => { - if (!!prevSelection && selectionProp.start === prevSelection.start && selectionProp.end === prevSelection.end) { - return; - } - return selectionProp; - }); + if (!!selection && selectionProp.start === selection.start && selectionProp.end === selection.end) { + return; + } + setSelection(selectionProp); + // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps }, [selectionProp]); /**