React life cycle?

  1. componentWillMount() – Executed before rendering, both on the client and server.

  2. componentDidMount() – only executed on the client side after the first render.

  3. componentWillReceiveProps() – Called when props are received from the parent class and before calling another renderer.

  4. shouldComponentUpdate() – Returns true or false based on specific conditions. If you wish to update the component, return true otherwise return false. By default, it returns false.

  5. componentWillUpdate() – Called before rendering in the DOM.

  6. componentDidUpdate()– Called immediately after rendering occurs.

  7. componentWillUnmount() – Called after unmounting the component from the DOM. Used to clear memory space.

Guess you like

Origin blog.csdn.net/m0_45865109/article/details/125548095