Project

General

Profile

Actions

Feature #21563

closed

Include babel-plugin-transform-class-properties so we can use static class variables

Added by Walden Raines about 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Web Interface
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

In order to do things like this:

class RedHatRepositoriesPage extends Component {
  static defaultProps = {
    redHatRepositoriesResponse: {},
    redHatRepositorySetsResponse: {}
  };

  static propTypes = {
    loadRedHatRepositories: PropTypes.func.isRequired,
    loadRedHatRepositorySets: PropTypes.func.isRequired,
    redHatRepositoriesResponse: PropTypes.object,
    redHatRepositorySetsResponse: PropTypes.object
  };

  ...

}

We need the babel plugin babel-plugin-transform-class-properties. To me, the above is clearer than:

class ChartBox extends React.Component {
  ...
}

ChartBox.PropTypes = {
  status: PropTypes.string.isRequired,
  config: PropTypes.object,
  modalConfig: PropTypes.object,
  id: PropTypes.string.isRequired,
  noDataMsg: PropTypes.string,
  errorText: PropTypes.string
};
Actions

Also available in: Atom PDF