Fork me on GitHub
摘要: 🚀 在 React 应用中,我们经常需要在组件之间共享状态和数据。而 React 的 createContext 和 Provider 就是为了解决这个问题而诞生的。 createContext:创建自定义上下文 首先,让我们来看看 createContext。这个函数接受一个初始值作为参数,并返 阅读全文
posted @ 2024-04-04 21:17 azoux 阅读(57) 评论(0) 推荐(0) 编辑