nodejsinaction icon indicating copy to clipboard operation
nodejsinaction copied to clipboard

Fix bind usage

Open ahmedengu opened this issue 5 years ago • 1 comments

Greetings,

This PR address the usage of bind in render and with listeners. bind returns a new function every time its called, so using it in render would cause performance degradation due to the creation of a new function every time and the subsequent unnecessary renders of child components Also, using it with listers causes memory leaks; as a result of creating a new function each time, the lister will not be able to remove the existing listener using the new reference.

Best Regards, Ahmed

ahmedengu avatar Sep 23 '20 09:09 ahmedengu

@morozzzDima I think it's for @alexyoung as the maintainer of the repo.

ahmedengu avatar Sep 24 '20 08:09 ahmedengu