Example of using forward ref
What we trying to achieve here is that when we use the logo component we stil get the classes of tailwind if dont do the forwardRef the component does not know or do auto suggest classes
/logo.tsx
type ImgProps = React.ImgHTMLAttributes<HTMLImageElement> & {
imgSrc: string
}
export default React.forwardRef<HTMLImageElement, ImgProps>(
({ className, imgSrc, ...props }, ref) => {
return <img src={imgSrc} className={className} ref={ref} {...props} />
}
)