reactjs / react-art

React Bridge to the ART Drawing Library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Propagating events through tree

fabslab opened this issue · comments

Another question to do with a similar project to this. I would like to hook into React's event system to dispatch events (to begin with keydown) through the tree, bubbling from my target which in this case is not a DOM node but a custom React component that is backed by a scene graph node in a WebGL library, constructed similarly to the ReactART components. Because of this the target of the native browser event is of course not the actual target React component I would like to propogate from.
To dispatch I see I can do something like this:
ReactEventListener.dispatchEvent(EventConstants.topLevelTypes.topKeyDown, browserEvent);
But that leads to the ReactMount module attempting to iterate through the ancestors using a mapping to DOM nodes. Is there a suggested way to change this behavior so it can receive my desired target ReactComponent and walk up the tree from that instead, to execute the event handling?

This isn't supported, sorry.

Okay thanks, just wanted to see if there was anything I should look at before I figure a way out on my own.