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

562 Views Asked by At

If Cycle uses virtual dom and so does React, then why can I not use React Components inside a Cycle.js app?

Would it be possible to use wrap existing React Components into Cycle.js components ?

This question relates to : Higher order FRP with React - why is it not happening?

2

There are 2 best solutions below

2
On BEST ANSWER

Because React's support for Web Components is lacking. See https://github.com/facebook/react/issues/7901 and http://staltz.com/react-could-love-web-components.html

It is technically possible to build React support in Cycle.js, but then you may also start asking whether other frameworks like Ember or Angular or Aurelia should start doing the same out of the box. Then, the question could be expanded even further by asking Aurelia components to be supported in Ember. So building support for "Foo" components in "Bar" framework is counter-productive. Web Components are the sane way to handle this.

0
On

Cycle.js is generic enough to be used along other frameworks/libraries. In fact there's redux-cycle-middleware which allows you to use React/Redux along with Cycle.js. With this middleware you wouldn't be using Cycle to handle DOM side-effects; instead you'd use React. Then when you need to handle other side-effects (HTTP, WebSockets, anything that isn't DOM...) you can use Cycle.js.