6 ms·
In addition to what lopatin replied to you - sometimes your component have to subscribe to some window event - for example 'resize'. I'd say it is way better to
by Ronsenshi 11y ago
In addition to what lopatin replied to you - sometimes your component have to subscribe to some window event - for example 'resize'. I'd say it is way better to handle this event attachment/removal within the component instead of inventing some convoluted system of events in the root container which broadcast changes.
There's a number of situations when functional component just not enough.