How To Handle DOM and Window Events with React
In JavaScript apps using the React front-end library, you can use event handlers to update state data, trigger prop changes, or prevent default browser actions. To do this, React uses a SyntheticEvent wrapper instead of the native Event interface. In this tutorial, you’ll build several sample components that handle user events. You’ll learn how to add event handlers to components, pull information from the SyntheticEvent, and add and remove Window event listeners.