7

I have a container component:

import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';

class MyComponent extends Component {
  static propTypes = {
     someEntities: PropTypes.object.isRequired
  }
  ....
}

export default connect(state => ({ someEntities: state.someEntities })(MyComponent)

So I am passing props via connect to this component, but when I place component in code, like:

....
import MyComponent from './MyComponent';
....
<div><MyComponent /></div>
....

WebStorm highlights MyComponent and gives me an error: Element MyComponent doesn't have required attribute someEntities.

I am using version 2016.3.1. Is this an error? Should I use propTypes in this case?

1 Answer 1

8

This is a known issue, tracked as WEB-21692; please follow it for updates (https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.