Hey folks, I tried to get this working locally but ended up pausing since React and TypeScript were having troubles getting along.
Use-case is that reporting listens for custom DOM events to get a signal that all the important components are done loading. Since we only have access to native events by means of the document.querySelector API, we can't "hook" into react (haha). To that end, it'd be nice if components handled ref's appropriately, and for our immediate case this is in EuiFlexGroup though I can see it expanding.
According to this document: https://reactjs.org/docs/forwarding-refs.html we simply need to wrap the component in a React.forwardRef call, however this immediately causes TS to throw some issues which I couldn't untangle.
Hey folks, I tried to get this working locally but ended up pausing since React and TypeScript were having troubles getting along.
Use-case is that reporting listens for custom DOM events to get a signal that all the important components are done loading. Since we only have access to native events by means of the
document.querySelectorAPI, we can't "hook" into react (haha). To that end, it'd be nice if components handledref's appropriately, and for our immediate case this is inEuiFlexGroupthough I can see it expanding.According to this document: https://reactjs.org/docs/forwarding-refs.html we simply need to wrap the component in a
React.forwardRefcall, however this immediately causes TS to throw some issues which I couldn't untangle.