Skip to content

Instantly share code, notes, and snippets.

@kartikag01
Created August 30, 2018 07:46
Show Gist options
  • Select an option

  • Save kartikag01/09295d052967830267d02505b7095ff3 to your computer and use it in GitHub Desktop.

Select an option

Save kartikag01/09295d052967830267d02505b7095ff3 to your computer and use it in GitHub Desktop.
After ComponentWillMount lifecycle change
constructor(props) {
super(props);
this.state = { loading: true };
}
componentDidMount() {
this.props.fetchData(); // action dispatch
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment