usePassiveLayoutEffect.tsx 292 Bytes
Newer Older
Yoon, Daeki's avatar
Yoon, Daeki committed
1
2
3
4
5
6
7
8
9
10
11
12
13
/**
 * 출처: https://github.com/jaredLunde/react-hook
 */
import React from "react";

const usePassiveLayoutEffect =
  React[
    typeof document !== "undefined" && document.createElement !== void 0
      ? "useLayoutEffect"
      : "useEffect"
  ];

export default usePassiveLayoutEffect;