I'm trying to implement wrapper tags that binds to events on child DOM element and then does something according to them.
I have following code:
const Wrapper: React.FC = (props) => {
// How do I get access to child div DOM element here??
someComponent.eventListenerOn(childDOMElement);
return <>{props.children}</>;
};
const ChildStuff: React.FC = () => {
return (
<Wrapper>
<div id="xyzzy"></div>
</Wrapper>
);
};
In Wrapper
, how do I get access to child DOM element?