Created
May 18, 2019 23:31
-
-
Save drewwyatt/9cb2bcb8a51e6f74af3ff9432939d106 to your computer and use it in GitHub Desktop.
onClick={wat} snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Summary of `ReactBrowserEventEmitter` event handling: | |
* | |
* - Top-level delegation is used to trap most native browser events. This | |
* may only occur in the main thread and is the responsibility of | |
* ReactDOMEventListener, which is injected and can therefore support | |
* pluggable event sources. This is the only work that occurs in the main | |
* thread. | |
* | |
* - We normalize and de-duplicate events to account for browser quirks. This | |
* may be done in the worker thread. | |
* | |
* - Forward these native events (with the associated top-level type used to | |
* trap it) to `EventPluginHub`, which in turn will ask plugins if they want | |
* to extract any synthetic events. | |
* | |
* - The `EventPluginHub` will then process each event by annotating them with | |
* "dispatches", a sequence of listeners and IDs that care about that event. | |
* | |
* - The `EventPluginHub` then dispatches the events. | |
* | |
* Overview of React and the event system: | |
* | |
* +------------+ . | |
* | DOM | . | |
* +------------+ . | |
* | . | |
* v . | |
* +------------+ . | |
* | ReactEvent | . | |
* | Listener | . | |
* +------------+ . +-----------+ | |
* | . +--------+|SimpleEvent| | |
* | . | |Plugin | | |
* +-----|------+ . v +-----------+ | |
* | | | . +--------------+ +------------+ | |
* | +-----------.--->|EventPluginHub| | Event | | |
* | | . | | +-----------+ | Propagators| | |
* | ReactEvent | . | | |TapEvent | |------------| | |
* | Emitter | . | |<---+|Plugin | |other plugin| | |
* | | . | | +-----------+ | utilities | | |
* | +-----------.--->| | +------------+ | |
* | | | . +--------------+ | |
* +-----|------+ . ^ +-----------+ | |
* | . | |Enter/Leave| | |
* + . +-------+|Plugin | | |
* +-------------+ . +-----------+ | |
* | application | . | |
* |-------------| . | |
* | | . | |
* | | . | |
* +-------------+ . | |
* . | |
* React Core . General Purpose Event Plugin System | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment