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
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.