June 21, 2020
What is the difference between HTML and React event handling?
- In HTML, the event name should be in lowercase:
Whereas in React it follows camelCase convention:
2. In HTML, you can return false to prevent default behavior:
Whereas in React you must call preventDefault() explicitly:
3. In HTML, you need to invoke the function by appending () Whereas in react you should not append () with the function name. (refer "activateLasers" function in the first point for example)
June 21, 2020, 20:25
0 views
0 reactions
0 reposts