Property does not exist on type ‘IntrinsicAttributes & { children?: ReactNode; }’

// 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

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)