narayan954 / dummygram

DummyGram is a social media application where we have posts, stories, chat, friends, authentication, comment, delete, share and like feature. It uses ReactJs in the frontend for the UI and Firebase for the backend storing the users, posts, stories and comments.
https://narayan954.github.io/dummygram/
MIT License
78 stars 184 forks source link

Fix event listener leaking #1180

Closed Palakkgoyal closed 1 year ago

Palakkgoyal commented 1 year ago

This PR closes #1142 Fixed the memory leaking. The event listener was not remove correctly from the useEffect as they have give name of the constant instead of the function and I think window.addEventListenere doesn't return anything. So, the constant become undefined.

narayan954 commented 1 year ago

This PR closes #1142 Fixed the memory leaking. The event listener was not remove correctly from the useEffect as they have give name of the constant instead of the function and I think window.addEventListenere doesn't return anything. So, the constant become undefined.

yup my fault ;-;