Skip to content

Commit

Permalink
Remove nested ternary
Browse files Browse the repository at this point in the history
  • Loading branch information
aryaemami59 committed Apr 10, 2024
1 parent 5ba0d93 commit 691b1a2
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/utils/useIsomorphicLayoutEffect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,5 @@ export const canUseDOM = !!(
export const isReactNative =
typeof navigator !== 'undefined' && navigator.product === 'ReactNative'

export const useIsomorphicLayoutEffect = canUseDOM
? React.useLayoutEffect
: isReactNative
? React.useLayoutEffect
: React.useEffect
export const useIsomorphicLayoutEffect =
canUseDOM || isReactNative ? React.useLayoutEffect : React.useEffect

0 comments on commit 691b1a2

Please sign in to comment.