When do you need to use redux?

redux usage scenario, teacher Ruan Yifeng"s blog from a single source

scenarios where redux is required:
  • users use complicated ways
  • users with different identities have different ways of using them (such as ordinary users and administrators)
  • multiple users can collaborate
  • interacts heavily with the server, or uses WebSocket
  • View needs to obtain data from multiple sources

question:
1. What do you mean by "View getting data from a single source" and "getting data from multiple sources" mentioned above?
2. If you use react to write a separate blog with front and back end, which involves registration, login, and the addition, deletion, modification and query of articles, do you need redux for this scenario?

Sep.16,2021

Redux is used to manage the state uniformly. The project is relatively complex, and many global variables are needed. If there are more cross-component operations, it needs

.

if the pages are not very complex and the pages are relatively independent, it is not necessary to use Redux

.

ordinary blogs are not too complicated, so there is no need to use these

if it is a react project, you can replace Redux with the new context API. After all, it comes with it, and you can also implement global state management

.
  1. roughly means that redux can be divided into modules.

for example, each page is a module stored in redux, if one page needs to use the data of another page. The other page is not easy to put globally.
this kind of situation is more common in your project, so you can consider redux.

  1. Registration, login, additions, deletions and changes of article entities I don't think it's necessary to redux.

You Might Not Need Redux

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eaf1e6-5d049.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eaf1e6-5d049.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?