{"action":"created","issue":{"url":"https://api.github.com/repos/gaearon/overreacted.io/issues/29","repository_url":"https://api.github.com/repos/gaearon/overreacted.io","labels_url":"https://api.github.com/repos/gaearon/overreacted.io/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/gaearon/overreacted.io/issues/29/comments","events_url":"https://api.github.com/repos/gaearon/overreacted.io/issues/29/events","html_url":"https://github.com/gaearon/overreacted.io/issues/29","id":387674044,"node_id":"MDU6SXNzdWUzODc2NzQwNDQ=","number":29,"title":"Add a post explaining when React creates SyntheticEvents","user":{"login":"brainlessdeveloper","id":16181067,"node_id":"MDQ6VXNlcjE2MTgxMDY3","avatar_url":"https://avatars1.githubusercontent.com/u/16181067?v=4","gravatar_id":"","url":"https://api.github.com/users/brainlessdeveloper","html_url":"https://github.com/brainlessdeveloper","followers_url":"https://api.github.com/users/brainlessdeveloper/followers","following_url":"https://api.github.com/users/brainlessdeveloper/following{/other_user}","gists_url":"https://api.github.com/users/brainlessdeveloper/gists{/gist_id}","starred_url":"https://api.github.com/users/brainlessdeveloper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brainlessdeveloper/subscriptions","organizations_url":"https://api.github.com/users/brainlessdeveloper/orgs","repos_url":"https://api.github.com/users/brainlessdeveloper/repos","events_url":"https://api.github.com/users/brainlessdeveloper/events{/privacy}","received_events_url":"https://api.github.com/users/brainlessdeveloper/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-12-05T09:49:32Z","updated_at":"2018-12-05T11:53:39Z","closed_at":null,"author_association":"NONE","body":"Congrats on your new blog, the posts are great so far.\r\n\r\nSome time ago I asked [this question on StackOverflow](https://stackoverflow.com/questions/52444941/when-does-react-create-syntheticevents) and didn't get a satisfactory answer. I ended up answering and accepting my own answer, because that's the closest I ever got to one.\r\n\r\nI think you might know better?\r\n\r\n### Original question follows\r\n\r\nRight now, this is the way I understand event handling in React:\r\n\r\n  1. The native event capture phase happens\r\n  2. The native event reaches target\r\n  3. The native event bubbles back up\r\n  4. React catches it at the `document` layer\r\n  5. React puts it in its `EventPluginHub`\r\n  6. React simulates another full capture/bubble roundtrip for the `SyntheticEvent`\r\n  7. React runs the handlers you built in your code\r\n\r\nIf my understanding of React internals is correct, and taking into account [this part](https://www.w3.org/TR/uievents/#event-flow) of the HTML spec:\r\n\r\n> Event objects are dispatched to an event target. But before dispatch\r\n> can begin, the event object’s propagation path must first be\r\n> determined.\r\n\r\nDoes React wait until the event bubbles up to `document` to create its `SyntheticEvent`? And if so, why? In the first step of the event's life, all info about its propagation path is known, so they could do it there."},"comment":{"url":"https://api.github.com/repos/gaearon/overreacted.io/issues/comments/444459709","html_url":"https://github.com/gaearon/overreacted.io/issues/29#issuecomment-444459709","issue_url":"https://api.github.com/repos/gaearon/overreacted.io/issues/29","id":444459709,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NDQ1OTcwOQ==","user":{"login":"coocooooo","id":7315454,"node_id":"MDQ6VXNlcjczMTU0NTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/7315454?v=4","gravatar_id":"","url":"https://api.github.com/users/coocooooo","html_url":"https://github.com/coocooooo","followers_url":"https://api.github.com/users/coocooooo/followers","following_url":"https://api.github.com/users/coocooooo/following{/other_user}","gists_url":"https://api.github.com/users/coocooooo/gists{/gist_id}","starred_url":"https://api.github.com/users/coocooooo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coocooooo/subscriptions","organizations_url":"https://api.github.com/users/coocooooo/orgs","repos_url":"https://api.github.com/users/coocooooo/repos","events_url":"https://api.github.com/users/coocooooo/events{/privacy}","received_events_url":"https://api.github.com/users/coocooooo/received_events","type":"User","site_admin":false},"created_at":"2018-12-05T11:53:39Z","updated_at":"2018-12-05T11:53:39Z","author_association":"NONE","body":"+1"}}
{"actor":{"display_login":"coocooooo"}}