为什么我不能在 Cycle.js 应用程序中使用 React 组件?

Why can I not use a React Component in a Cycle.js app?

如果 Cycle 使用虚拟 dom,React 也是,那么为什么我不能在 Cycle.js 应用程序中使用 React Components

是否可以将现有的 React 组件包装到 Cycle.js 组件中?

此问题涉及:Higher order FRP with React - why is it not happening?

因为 React 缺少对 Web 组件的支持。参见 https://github.com/facebook/react/issues/7901 and http://staltz.com/react-could-love-web-components.html

在 Cycle.js 中构建 React 支持在技术上是可行的,但随后您可能还会开始询问 Ember 或 Angular 或 Aurelia 等其他框架是否应该开始做同样的事情的盒子。然后,可以通过询问 Ember 中支持 Aurelia 组件来进一步扩展问题。因此,在 "Bar" 框架中构建对 "Foo" 组件的支持会适得其反。 Web Components 是处理这个问题的明智方式。

Cycle.js 足够通用,可以与其他 frameworks/libraries 一起使用。事实上,redux-cycle-middleware 允许您将 React/Redux 与 Cycle.js 一起使用。有了这个中间件,您就不会使用 Cycle 来处理 DOM side-effects;相反,你会使用 React。然后,当您需要处理其他 side-effects(HTTP、WebSockets,任何不是 DOM...)时,您可以使用 Cycle.js.