javascriptreactjsreduxreactjs-fluxreact-redux

What are differences between redux, react-redux, redux-thunk?


I am using React + Flux. Our team is planning to move from flux to redux. Redux is very confusing for me coming from flux world. In flux control flow is simple from Components -> actions -> Store and store updates back components. Its simple and very clear.

But in redux its confusing. There is no store here, yes there are some examples without using store. I went through several tutorials, it seems everyone has their own style of implementation. Some are using Containers and some are not. (I don't know this Containers concept and not able to understand what mapStateToProps, mapDispatchToProps does).

  1. Can someone clearly explain how control flow happens in redux ?
  2. What are roles of components/containers/actions/action creators/store in redux ?
  3. Difference between redux/react-redux/redux-thunk/any others ??
  4. It would be very helpful if you can post links to any simple and precise redux tutorials.

Solution

    1. Can someone clearly explain how control flow happens in redux ?

    Redux has (always) a single store.

    1. Whenever you want to replace the state in the store, you dispatch an action.

    2. The action is caught by one or more reducers.

    3. The reducer/s create a new state that combines the old state, and the dispatched action.

    4. The store subscribers are notified that there is a new state.

    1. What are roles of components/containers/actions/action creators/store in redux ?

    Note that containers / smart components vs. dumb components is just a good way to structure your app.


    1. Difference between redux/react-redux/redux-thunk/any others ?
    1. It would be very helpful if you can post links to any simple and precise redux tutorials.