I have a general component such as this
const Img = ({ component }) => {
const image_ref = useRef()
return (
<>
{component
ref={image_ref}
}
</>
)
}
And I want to use it with other components like these
const MyImg = () => <Img component={<MySpecificImg />} />
const MyBackImg = () => <Img component={<MySpecificBackImg />} />
Is there any way to do this?
The need is to be able to change the component that the <Img/>
component calls