Pass properties to super in derived classes. Fixes #289

Thanks!
This commit is contained in:
Peter Blazejewicz 2018-02-03 15:54:36 +01:00 committed by Steve Sanderson
parent 6b44610079
commit 3d118de0d5
2 changed files with 4 additions and 4 deletions

View File

@ -3,8 +3,8 @@ import React, { Component } from 'react';
export class Counter extends Component {
displayName = Counter.name
constructor() {
super();
constructor(props) {
super(props);
this.state = { currentCount: 0 };
this.incrementCounter = this.incrementCounter.bind(this);
}

View File

@ -3,8 +3,8 @@ import React, { Component } from 'react';
export class FetchData extends Component {
displayName = FetchData.name
constructor() {
super();
constructor(props) {
super(props);
this.state = { forecasts: [], loading: true };
fetch('api/SampleData/WeatherForecasts')