Calling a function in React

前端 未结 6 1976
感动是毒
感动是毒 2021-02-04 21:55

I\'m a beginner in React, and I\'m a little confused about calling a function in React.

I saw the following ways and I don\'t know when to use each and which one.

<
6条回答
  •  旧巷少年郎
    2021-02-04 22:31

    To call the function you have to add ()

    {this.handleAddTodo()}   
    

    About handling events - Handling#Events

    Arrow Functions - Functions#ArrowFunctions

提交回复
热议问题