From 25a0730bf5270d9a0096b41f03df275cab7f42ff Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 12 Jan 2023 10:57:39 -0600 Subject: [PATCH] StatusContent: useLayoutEffect, fix "read more" button glitchiness on React 18 --- app/soapbox/components/status-content.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/soapbox/components/status-content.tsx b/app/soapbox/components/status-content.tsx index c361c2289..bedef1fa6 100644 --- a/app/soapbox/components/status-content.tsx +++ b/app/soapbox/components/status-content.tsx @@ -1,5 +1,5 @@ import classNames from 'clsx'; -import React, { useState, useRef, useEffect, useMemo } from 'react'; +import React, { useState, useRef, useLayoutEffect, useMemo } from 'react'; import { FormattedMessage } from 'react-intl'; import { useHistory } from 'react-router-dom'; @@ -119,7 +119,7 @@ const StatusContent: React.FC = ({ status, onClick, collapsable } }; - useEffect(() => { + useLayoutEffect(() => { maybeSetCollapsed(); maybeSetOnlyEmoji(); updateStatusLinks();