ReactJS: componentDidMount, componentWillUnmount
Please explain two things to amateur:
I understand correctly, the first one goes after the first successful brand, and the second before the virtual DOM element is removed?
Comment, if it's not too hard, on.
emmalee last edited by
componentDidMountCalled immediately after the first delineation of the component. In this method, asynchronous queries, initialization of timers, etc. are usually made. References are also available from this point of view
componentWillUnmountis performed immediately prior to the removal of the DOM component. There is a different kind of cleaning: removal of any elements, stop of timers, interruption of requests to the server if they have not yet been completed.