react 引入组件_引入React负载—无头React组件,用于处理承诺状态和响应数据

react 引入组件

by Jake Moxey

杰克·莫西(Jake Moxey)

引入React负载—无头React组件,用于处理承诺状态和响应数据 (Introducing React Loads — A headless React component to handle promise states and response data)

简单,声明性和轻量级 (Simple, declarative, and lightweight)

背景 (Background)

There are so many methods to handle state in React right now. From local state to Redux, the new React Context API and new libraries such as Unstated and Copy Write. All these methods have great use cases, and there are no absolutes in which I’d drop one entirely in favour of another. Each of them have their situational benefits.

现在有很多方法可以在React中处理状态。 从本地状态Redux ,新的React Context API 新的库,例如Unstated 复制写 。 所有这些方法都有很好的用例,没有绝对的方法可以让我完全放弃另一种方法。 他们每个人都有自己的处境利益。

But I don’t want to get into the nitty gritty of React state management. Check out Kent C. Dodd’s excellent article about Application State Management for that.

但是我不想陷入React状态管理的棘手问题。 请查看Kent C. Dodd撰写的有关应用程序状态管理的出色文章。

Though I do want to touch on the case of handling loading and response state from a promise, for example HTTP requests and resource fetchers. A promise has three explicit states: pending,

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值