I am trying to make my component accept a ref.
I have a component like so:
const MyComponent: RefForwardingCom
Your code is right but you are missing a small detail.
When you use RefForwardingComponent
you need to export the component wrapped with forwardRef
import React, { forwardRef, RefForwardingComponent } from 'react';
type IMyComponentProps = {}
const MyComponent: RefForwardingComponent = (props, ref) => {
return Hoopla
}
export default forwardRef(MyComponent);