UNPKG

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