Open itsdouges opened 3 years ago
Yeah that's a bit of a weird one.
I think case one and two both work without the memo
. We'll need to add some additional smarts to get it to work with it though.
This should work if you wrap a typed forwardRef
in an untyped memo
. Not ideal, just sharing incase you were blocked 😄
import React, { forwardRef, memo } from 'react';
type MyComponentProps = {
foo: string,
}
const MyComponent = memo(forwardRef<HTMLElement, MyComponentProps>((props, ref) => {
return <span>Foo</span>;
}));
export default MyComponent;
Doesn't work:
Doesn't work:
Works