Debian Codegraph @

node/@patternfly/react-core/src/helpers/useIsomorphicLayout.ts

raw
1 import { useEffect, useLayoutEffect } from 'react';
2 import { canUseDOM } from './util';
3
4 /**
5 * Small wrapper around `useLayoutEffect` to get rid of the warning on SSR envs
6 */
7 export const useIsomorphicLayoutEffect = canUseDOM ? useLayoutEffect : useEffect;