I'm using React Typescript and I have the following warning:
warning Missing return type on function
This is my code:
useEffect(() => {
window.addEventListener('scroll', fetchAllFriends, { once: true })
return () => {
window.removeEventListener('scroll', fetchAllFriends)
}
}, [fetchAllFriends])
Does that mean that we need a return (): void on every cleanup function inside useEffect?