Relative Content

Tag Archive for reactjsreact-hooksreact-lifecycle

React useEffect – in component or in service?

We have a hook (service) for our component, which have an init() and a shutdown() function (for some reason). The init() should be called at least once to initiate (starts a heart-beat operations), and the shutdown() to stop the heart-beat.