Skip to content

False positive for react/display-name #3289

@veloek

Description

@veloek

There seems to be a regression in version 7.30.0. Functions like these are now treated like components and trigger the react/display-name rule:

export const demo = (a?: string) => (b?: string) => {
    if (a == null) return null;
    return b;
}

I understand that it might be hard to separate function components from regular functions, but aren't React components always capitalized? Couldn't that be a way to identify them?

This wasn't a problem in version 7.29.4 of eslint-plugin-react.

[email protected]
[email protected]

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