Flow: Too few type arguments

Created on 14 Sep 2017  路  2Comments  路  Source: facebook/flow

I have a simple component like this:

import React from 'react';

type Props = {
    name: string
};

export default class MyComponent extends React.Component<Props> {
    render() {
        return (<p>{this.props.name}</p>);
   }
}

I get the following error:

React.Component (type application of property Component) Too few type arguments. Expected at least 3 DefaultProps, Props, State (See type parameters of definition here).


"flow-bin": "^0.54.0"

Most helpful comment

@AugustinLF It turns out I had [email protected] installed globally. Thank you!

All 2 comments

That's weird, if you look at this example, it does typecheck. Are you sure that you don't also have a global version of flow that it not up to date?

@AugustinLF It turns out I had [email protected] installed globally. Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mmollaverdi picture mmollaverdi  路  3Comments

ctrlplusb picture ctrlplusb  路  3Comments

marcelbeumer picture marcelbeumer  路  3Comments

philikon picture philikon  路  3Comments

cubika picture cubika  路  3Comments