Skip to content

React.ComponentType<any> flagged as unused when used as a param type in a method. #482

@kevinbarabash

Description

@kevinbarabash
function renderTab(Tab: React.ComponentType<any>): null {
    return null;
}

class Foo extends React.Component<Props, State> {
    renderTab(Tab: React.ComponentType<any>): null {  // 'ComponentType' is not defined. eslint(no-undef)
        return null;
    }
}

eslint only complains about the use of ComponentType when used as a param type in a method, but functions are fine.

This is using 5.7.2 of eslint-plugin-flowtype.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions