Skip to content

Commit

Permalink
Replace useLayoutEffect with useEffect on scroll button (#53483)
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorsector authored Dec 5, 2024
1 parent 3b5f834 commit 8cd4906
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/frame/components/ui/ScrollButton/ScrollButton.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 8cd4906

Please sign in to comment.