Skip to content

Commit

Permalink
Detect SSR by document
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipChalupa committed May 24, 2023
1 parent c7038aa commit 5a0e883
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utilities/useIsomorphicLayoutEffect.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, useLayoutEffect } from 'react'

export const useIsomorphicLayoutEffect =
typeof window !== 'undefined' ? useLayoutEffect : useEffect
typeof document !== 'undefined' ? useLayoutEffect : useEffect

0 comments on commit 5a0e883

Please sign in to comment.