I am creating a extension for Firefox, I insert this in page using Shadow dom. As we know react events not works in shadow dom, thus I use react-shadow-dom-retarget-events
package to re-target the events to shadow dom.
This works fine if event is attached to a React component & then to a native component inside it, but this is not working with only native component.
E.g.
<Button onClick={/*do something*/} />
In Button.js
<button onClick={e=>this.props.onClick()}>Click</button>
Will work, but following:
<span onClick={e=>console.log('Test')}>Click</span>
Will not work. I am able to figure out what is causing this behavior or ho to attach event to native dom elements also.