@rooks/use-isomorphic-effect
Version:
Resolves to useEffect when window is not in scope and useLayout effect in the browser
11 lines (8 loc) • 318 B
TypeScript
import { useEffect } from 'react';
/**
* useIsomorphicEffect
* Resolves to useEffect when "window" is not in scope and useLayout effect in the browser
* @param {function} callback Callback function to be called on mount
*/
declare const useIsomorphicEffect: typeof useEffect;
export default useIsomorphicEffect;