Skip to content

Commit d3594bd

Browse files
committed
Remove the one-time variable.
1 parent 8f7bae2 commit d3594bd

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/utils/useIsomorphicLayoutEffect.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ import { useEffect, useLayoutEffect } from 'react'
99
// is created synchronously, otherwise a store update may occur before the
1010
// subscription is created and an inconsistent state may be observed
1111

12-
const isHopefullyDomEnvironment =
12+
export const useIsomorphicLayoutEffect =
1313
typeof window !== 'undefined' &&
1414
typeof window.document !== 'undefined' &&
1515
typeof window.document.createElement !== 'undefined'
16-
17-
export const useIsomorphicLayoutEffect = isHopefullyDomEnvironment
18-
? useLayoutEffect
19-
: useEffect
16+
? useLayoutEffect
17+
: useEffect

0 commit comments

Comments
 (0)