tech/webdev magazine

July 12, 2019

The Circle of a React Lifecycle

Friday, July 12, 2019 Teklinks No comments

A React component goes through different phases as it lives in an application, though it might not be evident that anything is happening behind the scenes.Those phases are: mounting, updating, unmounting, error handling. There are methods in each of these phases that make it possible to perform specific actions on the component during that phase. For example, when fetching data from a network, you’d want to call the function that handles the API call in the componentDidMount() method, which is available during the mounting phase.

Full article

0 comments :

Post a Comment