Obtenez la taille de la fenêtre sur le redimensionnement

useEffect(() =>{
    let windowLength = document.documentElement.clientWidth || window.innerWidth;
    setWindowSize(windowLength);
  },[])
  console.log("onload is calling",windowSize);
  window.onresize= ()=>{
  let windowLength = document.documentElement.clientWidth || window.innerWidth;
  setWindowSize(windowLength);
  }
coderyogi