I have component with a trigger Element, the trigger Element is A react component like the following
const TriggerComponent = () => <div> trigger example </div>
<MyComponent trigger={<TriggerComponent />} />
Inside the MyComponent class, I want to add a ref attribute to the trigger Element by cloneElement or creatElement API, of course, I can't add a ref attribute to a functional component according to react documentation. So my idea is to convert the function component to class?
lets me know if you have any idea on how can I implement this idea?
reffrom theTriggerComponent?