惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

爱范儿
爱范儿
博客园_首页
W
WeLiveSecurity
S
Secure Thoughts
S
Security @ Cisco Blogs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Hugging Face - Blog
Hugging Face - Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
H
Hacker News: Front Page
Project Zero
Project Zero
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
U
Unit 42
N
News and Events Feed by Topic
N
News and Events Feed by Topic
Hacker News - Newest:
Hacker News - Newest: "LLM"
Forbes - Security
Forbes - Security
T
Tor Project blog
I
Intezer
B
Blog
F
Full Disclosure
Security Archives - TechRepublic
Security Archives - TechRepublic
F
Fortinet All Blogs
Schneier on Security
Schneier on Security
T
Threat Research - Cisco Blogs
AI
AI
Google DeepMind News
Google DeepMind News
L
LINUX DO - 最新话题
Cloudbric
Cloudbric
L
Lohrmann on Cybersecurity
WordPress大学
WordPress大学
博客园 - 聂微东
雷峰网
雷峰网
P
Privacy International News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
PCI Perspectives
PCI Perspectives
Y
Y Combinator Blog
Spread Privacy
Spread Privacy
Simon Willison's Weblog
Simon Willison's Weblog
罗磊的独立博客
Vercel News
Vercel News
A
Arctic Wolf
The Register - Security
The Register - Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
H
Heimdal Security Blog
Know Your Adversary
Know Your Adversary
P
Proofpoint News Feed
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed

博客园 - 风焰庄主

React中,useReducer和useState python, C++, C# 计算速度简单对比 对三层架构的简单改进 .net程序在64位系统上报 未在本地计算机上注册“Microsoft.Jet.OLEDB.4.0”提供程序 问题解决 DropBox把目录设置在U盘里面的方法 工作过公司的体会--结构完整的企业其实还是挺吸引人的 努力与付出 微软用于写Javascript的一个插件,Script# 项目管理的一点想法 介绍一况挺好用的Javascript编辑器(带项目) 简单的C#进行图片操作 PHP访问C#建立的Webservice 搜索引擎一:介绍 纪念一下Jerry 在中信66楼微软Offic参加讲座 关于地理信息信息点数据采集一些方法 介绍一下JS调试和浏览器调试工具 服务器不支持WebResource.axd的特殊处理 嫦娥一号发射
React中,useContext+useReducer对比Redux
风焰庄主 · 2021-01-22 · via 博客园 - 风焰庄主

如果需要在组件之间共享状态,可以使用useContext()。

useContext + useReducer可以一定程度上替代Redux

useReducer的store是独立分开的,并非一个独立的大状态,Redux是一个统一的状态。

useReducer的dispatch每个都是独立的,Redux是统一的对象。

useContext使得数据流不只是至上而下,也能往上传递。