Skip to content

Commit

Permalink
Remove Context calling React.Component constructor
Browse files Browse the repository at this point in the history
The React.Component takes one param in a call to super in the
constructor.
  • Loading branch information
justin808 committed Nov 20, 2016
1 parent b7ef433 commit b275918
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export default class HelloWorldContainer extends React.Component {
name: PropTypes.string.isRequired, // this is passed from the Rails view
};

constructor(props, context) {
super(props, context);
constructor(props) {
super(props);

// How to set initial state in ES6 class syntax
// https://facebook.github.io/react/docs/reusable-components.html#es6-classes
Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/client/app/components/HelloWorld.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class HelloWorld extends React.Component {
};

// Not necessary if we only call super, but we'll need to initialize state, etc.
constructor(props, context) {
super(props, context);
constructor(props) {
super(props);
this.state = props.helloWorldData;
this.setNameDomRef = this.setNameDomRef.bind(this);
this.handleChange = this.handleChange.bind(this);
Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/client/app/components/HelloWorldRedux.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export default class HelloWorldRedux extends React.Component {
};

// Not necessary if we only call super, but we'll need to initialize state, etc.
constructor(props, context) {
super(props, context);
constructor(props) {
super(props);
this.setNameDomRef = this.setNameDomRef.bind(this);
this.handleChange = this.handleChange.bind(this);
}
Expand Down

0 comments on commit b275918

Please sign in to comment.