You get a bonus - 1 coin for daily activity. Now you have 1 coin

What is the recommended ordering of methods in a component class? in REACT

Practice



  1. Recommended ordering of methods from mounting to the render stage :

    1. static
      methods
    2. constructor()
    3. getChildContext()
    4. componentWillMount()
    5. componentDidMount()
    6. componentWillReceiveProps()
    7. shouldComponentUpdate()
    8. componentWillUpdate()
    9. componentDidUpdate()
    10. componentWillUnmount()
    11. click handlers or event handlers such as
      onClickSubmit()
      or
      onChangeDescription()
    12. getter methods for render such as
      getSelectReason()
      or
      getFooterContent()
    13. optional render methods such as
      renderNavigation()
      or
      renderProfilePicture()
    14. render()

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Scripting client side JavaScript, jqvery, BackBone"

Terms: Scripting client side JavaScript, jqvery, BackBone