Why is thunk used in react?

In React / Redux, thunks enable us to avoid directly causing side effects in our actions , action creators, or components. Instead, anything impure will be wrapped in a thunk. Later, that thunk will be invoked by middleware to actually cause the effect.

Sizin İçin Seçtik  Is redux saga better than thunk?

Leave a Reply

Your email address will not be published. Required fields are marked *