Reputation: 78
I'm trying to catch React component's SyntheticEvent on native DOM element.
https://jsfiddle.net/xwh6dyur/2/
This code generate following DOM elements.
<div id="not-react-dom-outer">
<div id="not-react-dom-inner">
<div id="container">
<div data-reactid=".0">
<button data-reactid=".0.0">react button</button>
</div>
</div>
</div>
</div>
I expected event order below in accordance with normal Event bubbling.
but, actually is below.
I want to catch React SyntheticEvent before Native DOM Event.
Are there any good methodologies for that?
Upvotes: 0
Views: 515
Reputation: 2327
The React event handler isn't actually bound to button
, the event handler listening at the root of the React document, that's why the order in which these callbacks fire might not be as expected.
Upvotes: 1