Skip to content

3.6.2: 'react/display-name' throws false-positive in mixin methods that return JSX #256

@lyrebird

Description

@lyrebird

In the latest release, I'm hitting what appears to be a false-positive on display-name in a mixin. Here's a simplified example of the code that triggers it.

const Mixin = {
  renderButton() {
    return (
      <button />
    );
  }
};

It wasn't triggered prior to 3.6.0 -- I suspect it may be related to the changes to support stateless function components here: #237

A temporary work-around is to assign the JSX to a variable, and then return that. It only seems to trigger when a block of JSX is directly returned from the method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions