Performance counter updating error
Use this pattern with caution because it often causes performance issues.
It can, however, be necessary for cases like modals and tooltips when you need to measure a DOM node before rendering something that depends on its size or position. Note that React may call this method even if the props have not changed, so make sure to compare the current and next values if you only want to handle changes.
Initialization that requires DOM nodes should go here.
If you need to load data from a remote endpoint, this is a good place to instantiate the network request.
This method is a good place to set up any subscriptions.
Methods prefixed with function should be pure, meaning that it does not modify component state, it returns the same result each time it’s invoked, and it does not directly interact with the browser.a network request may not be necessary if the props have not changed).is invoked immediately before a component is unmounted and destroyed.A class component becomes an error boundary if it defines this lifecycle method.Calling in it lets you capture an unhandled Java Script error in the below tree and display a fallback UI.