I’d like to use
onClick on a React component in a shadow DOM node.
The problem is that React has a global event handler on the document and the shadow DOM retargets the event to make it look like it came from the host node. This prevents React from passing the event to the right element.
TextEditorComponent handles this by binding the event listeners on the component’s DOM node directly. However, this only allows you to handle events at the root element unless you do some hacky stuff with the DOM API.
Are there any best practices for doing something like this?