Some checks failed
My Build All / build_windows (push) Has been cancelled
My Build All / build_linux_portable (push) Has been cancelled
My Build All / build_linux_appimage (push) Has been cancelled
My Build All / build_macos (push) Has been cancelled
My Build All / Publish release assets (push) Has been cancelled
Shellcheck / Shellcheck (push) Has been cancelled
9 lines
No EOL
289 B
JavaScript
9 lines
No EOL
289 B
JavaScript
import { useEffect, useLayoutEffect } from 'react';
|
|
|
|
function useIsomorphicLayoutEffect(callback, deps) {
|
|
// eslint-disable-next-line
|
|
if (typeof window === 'undefined') return useEffect(callback, deps);
|
|
return useLayoutEffect(callback, deps);
|
|
}
|
|
|
|
export { useIsomorphicLayoutEffect }; |