Jesus sucks
This commit is contained in:
17
backend/frontend/node_modules/@restart/hooks/esm/useIsomorphicEffect.js
generated
vendored
Normal file
17
backend/frontend/node_modules/@restart/hooks/esm/useIsomorphicEffect.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import { useEffect, useLayoutEffect } from '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
|
||||
*/
|
||||
export default isDOM || isReactNative ? useLayoutEffect : useEffect;
|
||||
Reference in New Issue
Block a user