Skip to content

react/function-component-definition false positives on uncapitalized functions #3495

Open
@Janpot

Description

@Janpot

v7.31.10 => v7.31.11: upgrade results in a several false positives where uncapitalized functions that have a property assigned of either propTypes or defaultProps are detected as React components. (https://app.circleci.com/pipelines/github/mui/material-ui/85664/workflows/ddd6c2d7-00bc-4faf-bd09-f870eb96be44/jobs/452797)
This is new behavior. Not sure if intended?

example:

// Function component is not a function declaration
const fn = () => 'foo'
fn.propTypes = {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions