updating class component state react code example
Example: react lifecycle hooks
class Content extends React.Component {
// ...
componentWillMount() {
this.setState({ activities: data });
}
// ...
}
class Content extends React.Component {
// ...
componentWillMount() {
this.setState({ activities: data });
}
// ...
}