StatusContent: useLayoutEffect, fix "read more" button glitchiness on React 18

This commit is contained in:
Alex Gleason 2023-01-12 10:57:39 -06:00
parent 7e69eb2aa5
commit 25a0730bf5
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -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<IStatusContent> = ({ status, onClick, collapsable
}
};
useEffect(() => {
useLayoutEffect(() => {
maybeSetCollapsed();
maybeSetOnlyEmoji();
updateStatusLinks();