【问题标题】:Why do all the Recompose recipes start with "const { Component } = React;"为什么所有的 Recompose 配方都以“const { Component } = React;”开头
【发布时间】:2018-06-03 17:26:14
【问题描述】:

为什么所有 Recompose 配方都以 const { Component } = React; 开头而不使用 Component,还是这样?

这样开始配方有什么意义?

https://github.com/acdlite/recompose/wiki/Recipes

【问题讨论】:

    标签: reactjs recompose


    【解决方案1】:

    这是因为在代码中使用了 JSX。 JSX 被转译为 React.createElement,这显然使用了 React。

    【讨论】:

      猜你喜欢
      • 2011-07-21
      • 1970-01-01
      • 1970-01-01
      • 2012-03-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多