Is React onClick more like a Javascript addEventListener than like a standard Javascript onclick attribute?

前端 未结 0 1616
离开以前
离开以前 2021-02-10 23:23

In React is it better to think of onClick as setting an eventListener rather than as a standard Javascript onclick attribute?

For example, consider these two code snippet

相关标签:
回答
  • 消灭零回复
提交回复
热议问题