In javascript, we use onclick event and in React we use the onClick event. My question is event provides my React is the same as a javascript event or React handle event differently.
React uses a synthetic event system, which is a cross-browser wrapper around the browser's native event. In most cases, a developer may not notice the differences, but they do exist:
onclick
and onClick
events are the same.
The only difference is the capital of the "C".
Warning
onclick
event is deprecated in javascript. Now, we use addEventListener
and then onclick
event inside.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.