Retrieving data with Redux

What are the advantages of collecting data with Redux, as described here , versus using a regular template with

class Posts extends Component {
  state = { posts: [] };

  componentDidMount() {
    fetch(url).then(res => this.setState({ posts: res.json().posts });
  }

  render() {
    return ... 
  }
}

      

Is it easier to do asynchronous fetch? Does this help keep the data in storage so I can get it when I open the app again without having to re-run it?

+3


source to share


1 answer


It's not really a question of why pulling data from asynchronous actions, it seems like you need to understand what benefits the Redux library brings in general.



Read an article from the author of the Redux library, whether you really need Redux or not, or what benefits it brings: https://medium.com/@dan_abramov/you-might-not-need-redux-be46360cf367 p>

+1


source







All Articles