当前位置 : 主页 > 网络编程 > 其它编程 >

Addedarrowfunctiontoprops.onClick

来源:互联网 收集:自由互联 发布时间:2023-07-02
EarlierintheexampleitevenwarnsaboutsettingonClick={}asitwillcallthatfunct Earlier in the example it even warns about setting OnClick={} as it will call that function on every render call.This simply wraps it to prevent that inefficiency and
EarlierintheexampleitevenwarnsaboutsettingonClick={}asitwillcallthatfunct

Earlier in the example it even warns about setting OnClick={} as it will call that function on every render call.This simply wraps it to prevent that inefficiency and only call the function on click.

该提问来源于开源项目:reactjs/reactjs.org

Nevermind, I've started learning React and I now understand what's going on here, and how the injected JSX gets called when a render happens.

   

上一篇:暗黑3怎么设置技能?技能设置指南
下一篇:没有了
网友评论