Skip to content

isReactComponent() returns false for components without render() #174

Closed
@oluckyman

Description

@oluckyman

I have few components which render() method encapsulated into mixin.
Like so:

var Mixin = {
  render() {
    return (
      <h1>{ this.prop.header }</h1><div>{ this._renderBody() }</div>
    );
  }
};

var Comp1 = React.createClass({
  mixins: [ Mixin ],
  _renderBody() {
    return 'comp 1';
  }
});

var Comp2 = React.createClass({
  mixins: [ Mixin ],
  _renderBody() {
    return 'comp 2';
  }
});

And because of that some rules are ignored (e.g. sort-comp rule).
So I propose to check when there is no render() method inside component if the mixins prop is declared or not.

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