Skip to content

heading-has-content false positive for object spread #980

Open
@ghost

Description

The code throws an error.

const SectionTitle = (props) => (
  <h2 {...props} />
);

However, this code does not throw an error.

const SectionTitle = (props) => (
  <h2 {...props} >{props.children}</h2>
);

Both syntaxes produce the same output when rendered, which leads me to believe that the first syntax should not result in an error either.

Version: 6.8.0
スクリーンショット 2024-04-17 22 40 42

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