Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I'm not using propTypes i don't want liniting for props #75

Open
ankitsingh101 opened this issue Jun 23, 2020 · 0 comments
Open

I'm not using propTypes i don't want liniting for props #75

ankitsingh101 opened this issue Jun 23, 2020 · 0 comments

Comments

@ankitsingh101
Copy link

ankitsingh101 commented Jun 23, 2020

'title' is missing in props validation react-pug/prop-types
'items' is missing in props validation react-pug/prop-types

i'm getting error in this file collectionpreview jsx

const CollectionPreview = ({ title, items }) => (
  <div className="collection-preview">
    <h1 className="title">{title.toUpperCase()}</h1>
    <div className="preview">
      {items
        .filter((item, idx) => idx < 4)
        .map(({ id, ...OtherItemProps }) => (
          <CollectionItem key={id} {...OtherItemProps} />
        ))}
    </div>
  </div>

in shop component jsx

class ShopPage extends React.Component {
  state = {
    collections: SHOP_DATA
  };
  render() {
    const { collections } = this.state;
    return (
      <div className="shop-page">
        {collections.map(({ id, ...CollectionProps }) => (
          <CollectionPreview key={id} {...CollectionProps} />
        ))}
      </div>
    );
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant