Missing memo overload for MemoExoticComponent
steinybot opened this issue · 0 comments
steinybot commented
In the TS definitions there are 2 overloads for React.memo
:
function memo<P extends object>(
Component: SFC<P>,
propsAreEqual?: (prevProps: Readonly<PropsWithChildren<P>>, nextProps: Readonly<PropsWithChildren<P>>) => boolean
): NamedExoticComponent<P>;
function memo<T extends ComponentType<any>>(
Component: T,
propsAreEqual?: (prevProps: Readonly<ComponentProps<T>>, nextProps: Readonly<ComponentProps<T>>) => boolean
): MemoExoticComponent<T>;
Slinky has the first one (covered by 2 overloads because of the optional propsAreEqual
parameter) but not the second.
The one with MemoExoticComponent
is important because it will pull out the props from the component otherwise you end up with a component taking another component.