volleyball-dev-frontend/node_modules/@restart/hooks/cjs/useIsomorphicEffect.js
2025-06-02 16:42:16 +00:00

22 lines
636 B
JavaScript

"use strict";
exports.__esModule = true;
exports.default = void 0;
var _react = require("react");
const isReactNative = typeof global !== 'undefined' &&
// @ts-ignore
global.navigator &&
// @ts-ignore
global.navigator.product === 'ReactNative';
const isDOM = typeof document !== 'undefined';
/**
* Is `useLayoutEffect` in a DOM or React Native environment, otherwise resolves to useEffect
* Only useful to avoid the console warning.
*
* PREFER `useEffect` UNLESS YOU KNOW WHAT YOU ARE DOING.
*
* @category effects
*/
var _default = isDOM || isReactNative ? _react.useLayoutEffect : _react.useEffect;
exports.default = _default;