So I have a ref:
someComponent;
And the someComponent is basically a React component that looks like:
class SomeComponent<IProps> {
getData = () => {};
render() {
...some stuff
}
}
So, how can I type someComponent so if I do:
this.someComponent.getData();
The TypeScript won't shout that getData doesn't exist on this.someComponent?
I tried:
someComponent: React.RefObject<SomeComponent<IProps>>
But TypeScript still warns me.
Edit: Tried with createRef, however getting following error:
