Skip to content

Commit

Permalink
Remove unecessary requestAnimationFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
aeharding committed Apr 29, 2024
1 parent 48c2900 commit d468489
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/features/post/detail/ViewAllComments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,9 @@ export default function ViewAllComments({ onHeight }: ViewAllCommentsProps) {
const ref = useRef<HTMLAnchorElement>(null);

const heightChange = useCallback(() => {
requestAnimationFrame(() => {
if (!ref.current) return;
if (!ref.current) return;

onHeight?.(ref.current.getBoundingClientRect().height);
});
onHeight?.(ref.current.getBoundingClientRect().height);
}, [onHeight]);

useEffect(() => {
Expand Down

0 comments on commit d468489

Please sign in to comment.