import { DependencyList, EffectCallback, useLayoutEffect } from "react";

/**
 *  Source: https://medium.com/@alexandereardon/uselayouteffect-and-ssr-192986cdcf7a
 */

function noOpEffect(effect: EffectCallback, deps?: DependencyList) {
  // console.debug("No effect called", effect, deps);
}

const useBrowserEffect =
  typeof window !== "undefined" ? useLayoutEffect : noOpEffect;

export default useBrowserEffect;

import { DependencyList, EffectCallback, useLayoutEffect } from "react";

/**
 *  Source: https://medium.com/@alexandereardon/uselayouteffect-and-ssr-192986cdcf7a
 */


function noOpEffect(effect: EffectCallback, deps?: DependencyList) {
  console.debug("No effect called", effect, deps);
}

const useBrowserEffect =
  typeof window !== "undefined" ? useLayoutEffect : noOpEffect;

export default useBrowserEffect;

--- 
+++ 
@@ -4,9 +4,8 @@
  *  Source: https://medium.com/@alexandereardon/uselayouteffect-and-ssr-192986cdcf7a
  */
 
-
 function noOpEffect(effect: EffectCallback, deps?: DependencyList) {
-  console.debug("No effect called", effect, deps);
+  // console.debug("No effect called", effect, deps);
 }
 
 const useBrowserEffect =
Stop with all the debug output

