丶明旭 2021-11-10 11:16 采纳率: 100%
浏览 65
已结题

关于#react.js#的问题:react的hooks中,useReducer的第三个参数有什么用

react的hooks中,useReducer的第三个参数有什么用?initialArg和init的区别。

  • 写回答

1条回答 默认 最新

  • CSDN专家-showbo 2021-11-10 11:50
    关注

    As far as I can experiment, the init function as third arg is a transformer of the initialState.
    e文,题主参考下
    https://stackoverflow.com/questions/59041341/whats-the-purpose-of-the-3rd-argument-in-usereducer

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 11月19日
  • 已采纳回答 11月11日
  • 创建了问题 11月10日