Skip to content

prop-types not assigned via object literal do not work #355

Closed
@kesne

Description

@kesne

The Airbnb styleguide recommends putting proptypes in a variable at the top of the file, and then assigning it into propTypes. This causes the linting of propTypes to fail.

The following does not cause any linting errors, despite not including the proptypes validation.

const propTypes = {};

class Test extends React.Component {
  render() {
    return (
      <div>{this.props.name}</div>
    );
  }
}

Test.propTypes = propTypes;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions