Menu

Post image 1
Post image 2
1 / 2
0

React.js ~Life Cycle~

DEV Community·Ogasawara Kakeru·18 days ago
#jCAYAV2U
Reading 0:00
15s threshold

In React, the life cycle is composed of Mount(create) , Update(update) and Unmount(delete) . The life cycle method is defined as those of method. componentDidMount created when the first render once. Used when API connection, DOM manipulation. componentDidUpdate Run when updating DOM. Used in every time updating such as DOM manipulation. componentWillUnmount Run when deleting components. Used in eventListner, timer, and closing API connection. Side Effect Hook useEffect hook can replace the life cycle method instead. useEffect can be used for componentDidMount(runs when generate component) , componentDidUpdate(runs every time update) and componentWillUnmount(runs when delete component) .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More