Skip to content

Commit fd88816

Browse files
committed
Add getUseIsomorphicLayoutEffect with @__PURE__ annotation
1 parent 157e6c9 commit fd88816

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/utils/useIsomorphicLayoutEffect.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,8 @@ export const canUseDOM = !!(
2626
export const isReactNative =
2727
typeof navigator !== 'undefined' && navigator.product === 'ReactNative'
2828

29-
export const useIsomorphicLayoutEffect =
29+
const getUseIsomorphicLayoutEffect = () =>
3030
canUseDOM || isReactNative ? React.useLayoutEffect : React.useEffect
31+
32+
export const useIsomorphicLayoutEffect =
33+
/* @__PURE__ */ getUseIsomorphicLayoutEffect()

0 commit comments

Comments
 (0)