Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Context API and/or React-Redux-Thunk

Im using Context API for multi store management and React-Redux with thunk for a single store management.

Should I stick to one over the other or should I use React-Redux for multiple store management over React's Context API.

I spoke with a friend who did vice-versa versus me for his company and im wondering why but never got an explanation.

Whats the best practice?

like image 989
Andy Ou Avatar asked Apr 10 '26 04:04

Andy Ou


1 Answers

React Context API is somewhat harder to manage you can use redux instead to manage states. react-redux is just used as a connector between react and redux.

You can do the following for best practices:

  • For multi store management you can go for redux.
  • For connecting react with redux you can go for react-redux.
  • For middle ware you can either go for redux-thunk or redux-saga.

I prefer redux-saga as it has more advantages over redux-thunk.

like image 147
Abhinav Kushagra Avatar answered Apr 12 '26 00:04

Abhinav Kushagra



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!