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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy