UNPKG

@trellixio/roaster-coffee

Version:
21 lines 724 B
import * as React from 'react'; /** * A custom React effect hook that uses `useLayoutEffect` when executed in a browser environment and `useEffect` otherwise. * This hook is designed to handle potential issues with server-side rendering (SSR) where `useLayoutEffect` might cause a warning. * * @remarks * This hook is useful when you need to perform an effect that depends on the DOM but want to avoid warnings in a server-side rendered environment. * * @example * ```tsx * function MyComponent() { * useIsomorphicEffect(() => { * // Your effect logic goes here * }, []); * * // ... * } * ``` */ export declare const useIsomorphicEffect: typeof React.useEffect; //# sourceMappingURL=index.d.ts.map