Search code examples
clojurescriptreagent

What is the best way to use a reagent component in react js?


Say I have a reagent class with :reagent-render other reagent class/element, how can I convert this and export as a regular react component that can be mounted to regular react application?


Solution

  • Depending on which version of Reagent your using, it can vary a bit. If your using 0.5+, look at reagent.core/as-element, documented in the 0.5.0 News under Simple React Integration. If using 0.6+, the output of reagent.core/create-class can be used in JSX directly, as documented in the 0.6.0 Alpha News.