vendredi 15 novembre 2019

do i need to register window event listener in each react component?

I have an app written in ReactJS and I sometimes have to add window resize event listener, I now ended up having around 5 components and each one has its own window resize event listener, is there is any better way to handle this, I guess I am missing a design pattern or something that can handle my case .

Your help will be truly appreciated!

Aucun commentaire:

Enregistrer un commentaire