The last updating lifecycle method is
When a component instance updates,
componentDidUpdate gets called after any rendered HTML has finished loading.
Example for an an example of
componentDidUpdate automatically gets passed two arguments:
prevState are references to the component's
state before the current updating period began. You can compare them to the current
componentDidUpdate is usually used for interacting with things outside of the React environment, like the browser or APIs. It's similar to
componentWillUpdate in that way, except that it gets called after
render instead of before.