Ver código fonte

fix: debounce ref (#26433)

tags/1.9.1
crazywoola 1 mês atrás
pai
commit
fd86cadf67
Nenhuma conta vinculada ao e-mail do autor do commit
1 arquivos alterados com 7 adições e 2 exclusões
  1. 7
    2
      web/app/components/base/chat/chat/index.tsx

+ 7
- 2
web/app/components/base/chat/chat/index.tsx Ver arquivo

}) })


useEffect(() => { useEffect(() => {
window.addEventListener('resize', debounce(handleWindowResize))
return () => window.removeEventListener('resize', handleWindowResize)
const debouncedHandler = debounce(handleWindowResize, 200)
window.addEventListener('resize', debouncedHandler)

return () => {
window.removeEventListener('resize', debouncedHandler)
debouncedHandler.cancel()
}
}, [handleWindowResize]) }, [handleWindowResize])


useEffect(() => { useEffect(() => {

Carregando…
Cancelar
Salvar