// This is the piece we were missing --------------------v
const connect = function (Component: React.FC): React.FC<Props> {
const ComponentWrapper = function (props: Props): JSX.Element {
return <Component {...props} />;
};
return ComponentWrapper;
};
and after restarting the compiler it’ll work fine.
The type of the return value of the connect
function is a functional component that requires Props
, not a bare functional component.
See also the cheatsheet