what is the difference between createStore and createStoreWithMiddleware in react?

后端 未结 1 795
死守一世寂寞
死守一世寂寞 2021-01-05 14:59

I found two ways to configure redux createStore ,

1.https://github.com/TeamWithBR/SampleProjectTodo/blob/master/src/store/configureStore.js

2.https://github.

相关标签:
1条回答
  • 2021-01-05 15:59

    createStoreWithMiddleware is the old way to create the store with enhancers in Redux. In Redux version 3.1.0, a new approach has been introduced and now createStore receives an enhancer such as applyMiddleware() as the last optional argument.

    Now, the new createStore approach is preferable as it leads to code that is easier to read and reason about, but both will work.

    0 讨论(0)
提交回复
热议问题