From 8cd4906f4f442349036c3bdfc8da887b8edb104d Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Thu, 5 Dec 2024 13:03:40 -0500 Subject: [PATCH] Replace useLayoutEffect with useEffect on scroll button (#53483) --- src/frame/components/ui/ScrollButton/ScrollButton.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frame/components/ui/ScrollButton/ScrollButton.tsx b/src/frame/components/ui/ScrollButton/ScrollButton.tsx index 672b7e8f5a18..59149ebde57e 100644 --- a/src/frame/components/ui/ScrollButton/ScrollButton.tsx +++ b/src/frame/components/ui/ScrollButton/ScrollButton.tsx @@ -1,4 +1,4 @@ -import { useState, useEffect, useLayoutEffect } from 'react' +import { useState, useEffect } from 'react' import cx from 'classnames' import { ChevronUpIcon } from '@primer/octicons-react' import styles from './ScrollButton.module.scss' @@ -36,7 +36,7 @@ export const ScrollButton = ({ className, ariaLabel }: ScrollButtonPropsT) => { // If the window isn't tall enough, the scroll button will hide some of the content // A11y issue 8822 - useLayoutEffect(() => { + useEffect(() => { function updateDocumentSize() { setIsTallEnough(document.documentElement.clientHeight > 400) }