ChatPage: useLayoutEffect

This commit is contained in:
Alex Gleason 2023-01-06 11:51:47 -06:00
parent 8730a276c7
commit 5083096d1f
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, { useEffect, useRef, useState } from 'react';
import React, { useEffect, useLayoutEffect, useRef, useState } from 'react';
import { matchPath, Route, Switch, useHistory } from 'react-router-dom';
import { Stack } from 'soapbox/components/ui';
@ -44,7 +44,7 @@ const ChatPage: React.FC<IChatPage> = ({ chatId }) => {
setHeight(fullHeight - top + offset);
};
useEffect(() => {
useLayoutEffect(() => {
calculateHeight();
}, [containerRef.current]);