react-dev-inspector
Version:
dev-tool for inspect react components and jump to local IDE for component code.
8 lines (7 loc) • 375 B
JavaScript
var _a;
import { useEffect, useLayoutEffect as _useLayoutEffect, } from 'react';
export const useLayoutEffect = (typeof window !== 'undefined'
// @ts-expect-error `window` is not available in SSR
&& ((_a = window === null || window === void 0 ? void 0 : window.document) === null || _a === void 0 ? void 0 : _a.createElement))
? _useLayoutEffect
: useEffect;