Home > Web Front-end > Front-end Q&A > When to use react-redux

When to use react-redux

WBOY
Release: 2022-04-19 11:23:25
Original
2392 people have browsed it

Scenarios for using "react-redux": 1. When the user's usage method is complex; 2. When users with different identities have different usage methods; 3. When multiple users can collaborate; 4. When interacting with the server a lot, or using WebSocketView; 5. When data needs to be obtained from multiple sources.

When to use react-redux

The operating environment of this tutorial: Windows 10 system, react17.0.1 version, Dell G3 computer.

When to use react-redux

Scenarios where redux needs to be used:

  • The user’s usage is complex

  • Users with different identities have different usage methods (such as ordinary users and administrators)

  • Multiple users can Collaboration

  • Interacting heavily with the server, or using a WebSocketView

  • To get data from multiple sources

Scenarios where Redux is not required:

  • The user’s usage is very simple

  • No collaboration between users

  • No need for extensive interaction with the server, and no use of WebSocket

  • View layer (View) Only obtain data from a single source

Redux is used to manage status in a unified way. The project is relatively complex and requires many global variables. If there are many cross-component operations, it is necessary. The page is not very complex, and each page is relatively independent, so there is no need to use Redux. Generally, blogs are not too complicated, so there is no need to use these. If it is a react project, you can use the new contextAPI to replace Redux. After all, it comes with it, and you can also achieve global state management

Recommended learning: " react video tutorial

The above is the detailed content of When to use react-redux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template