I wanted to declare the type in my component this way, I already saw that this is possible using classes, but how could I do it using functional components? Without having to export the interface? I have already researched a lot and found nothing about it.
const Elem1 = forwardRef((props : any, ref : { open()? : void }) => { useImperativeHandle(ref, () => ({ open: () => console.log('opened') })) ....})const Elem2 = () => { const elem1Ref = useRef<Elem1>() elem1Ref?.current?.open() ....}