These methods are called when an instance of a component is being created and inserted into the DOM:
*constructor()*componentWillMount()
*render()
*componentDidMount()
An update can cause by changes to props or state. these methods are called when a component being re-render.
*componentWillReceiveProps()componentWillReceiveProps(nextProps){ // every time the parent component re-render the child component receive props }
*shouldComponentUpdate()
shouldComponentUpdate(nextProps,nextState){ // return true || false }
*componentWillUpdate()
*render()
*componentDidUpdate()
this method is called when a component is being removed from the DOM.
*componentWillUnmount()*componentDidCatch()
this method is called for handling errors when they occur during rendering, in a lifecycle method or in the constructor of any child component
*setState()
*forceUpdate()
*defaultProps
*displayName
*props
*state
1) you should measure it first in react application most of the optimization concerns happens during the update operation of a component.
*componentWillReceiveProps() method is not super useful for performance analysis