From 691b1a2ad3bc35d73cbacfda6e263d3929bb56af Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Wed, 10 Apr 2024 09:07:56 -0500 Subject: [PATCH] Remove nested ternary --- src/utils/useIsomorphicLayoutEffect.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/utils/useIsomorphicLayoutEffect.ts b/src/utils/useIsomorphicLayoutEffect.ts index 72a53ac18..7a57bd6fb 100644 --- a/src/utils/useIsomorphicLayoutEffect.ts +++ b/src/utils/useIsomorphicLayoutEffect.ts @@ -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