diff --git a/src/components/left/main/Chat.tsx b/src/components/left/main/Chat.tsx index 1e8f7b07f..767126b65 100644 --- a/src/components/left/main/Chat.tsx +++ b/src/components/left/main/Chat.tsx @@ -123,12 +123,12 @@ const Chat: FC = ({ // Sets animation excess values when `orderDiff` changes and then resets excess values to animate. useLayoutEffect(() => { - if (animationLevel === 0) { + const element = ref.current; + + if (animationLevel === 0 || !element) { return; } - const element = ref.current!; - // TODO Refactor animation: create `useListAnimation` that owns `orderDiff` and `animationType` if (animationType === ChatAnimationTypes.Opacity) { element.style.opacity = '0';