-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

React Interview Guide
By :

Event handling is essential for interacting with a web page in an application. React has its own event handling ecosystem. The event handler determines what action has to be taken whenever a particular event is fired. This section will give you a good understanding of event handling in the React library.
A synthetic event is a cross-browser wrapper around a browser’s actual native event object. It provides a unified API that prevents browser inconsistencies and ensures that the event works across multiple platforms.
There are some similarities between synthetic events and native events if you use the same preventDefault
and stopPropogation
methods in those two events. It is also possible to access native events directly by using the nativeEvent
attribute on the syntheticEvent
instance. As an example, the following search component is still able to access the native input event and other properties or methods inside...