UNPKG

635 BJavaScriptView Raw
1"use strict";
2
3exports.__esModule = true;
4exports.default = void 0;
5
6var _react = require("react");
7
8var isReactNative = typeof global !== 'undefined' && // @ts-ignore
9global.navigator && // @ts-ignore
10global.navigator.product === 'ReactNative';
11var isDOM = typeof document !== 'undefined';
12/**
13 * Is `useLayoutEffect` in a DOM or React Native environment, otherwise resolves to useEffect
14 * Only useful to avoid the console warning.
15 *
16 * PREFER `useEffect` UNLESS YOU KNOW WHAT YOU ARE DOING.
17 *
18 * @category effects
19 */
20
21var _default = isDOM || isReactNative ? _react.useLayoutEffect : _react.useEffect;
22
23exports.default = _default;
\No newline at end of file