LifeCycle Events In Ionic 4 – React :
This method is called every time. This method is good to initialize the data. Just before entering a View, this method is called.
After entering a View this method calls. When the user can able to see the view. As soon as the user was able to view the page this event fires.
This event fires when users are able to leave the view.
This event fires when the user completely leaves the view.
Although apart from this we have to know about react also having its own lifecycle
The Basic Events in react is as follows :
componentDidMount () :
This method fires immediately when the component is mounted. This method is good to initialize the data, Also to call a network HTTP request this method normally used. This method is used to call when subscribing to any data. setState() can also be called immediately.
This method calls when the update of data occurs. Please remember that this is not called when the view first renders. This method is also good to call network requests.
This method fires when users about to leave the view or destroy the view. This method is used to unsubscribe the data. This is not a place to call setState() as a component will never re-rendered.
So, remember the above LifeCycle method which React JS offers. But while using a framework like Ionic you did not worry about calling the above three basic methods.
As explained earlier ionic lifecycle will take care of it. Internally ionic calls the react lifecycle events.