38

你不必使用Redux:比较prop钻取、Redux和React Context API

 4 years ago
source link: https://juejin.im/post/5cf5d24d6fb9a07eb55f4802
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
React应用程序从根本上来说是一棵组件树,可以相互通信数据。在组件之间传递数据通常是无痛的。但是,随着应用程序树的增长,在保持可读代码库的同时传递数据变得更加困难。 假设我们有以下树结构: 这里有一个简单的树,有3个层次。在该树中,节点D和节点E都操纵一些

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK