here’s my code:
useEffect(() => {
function handleResize() {
setTimeout(() => {
//...
}, 0);
}
window.addEventListener("resize", handleResize);
return (_) => {
window.removeEventListener("resize", handleResize);
};
}, []);
I want to use this hook in class component, but i dont know how to convert. Is it possible to do this with lifecycle methods?