Does the reagent generate a React component that passes the React.isValidClass (component)?

I am trying to use a react router in my Clojurescript Reagent project. The problem is that the reaction router requires that the components pass React.isValidClass(component) , which in React 0.11.2 is defined as:

 ReactDescriptor.isValidFactory = function(factory) { return typeof factory === 'function' && factory.prototype instanceof ReactDescriptor; }; 

The reagent seems to generate components as an object instead of a function. Here is my code:

 (defn home [] [:div [:h1 "Home Page placeholder"]]) (reagent/as-component (home)) ; => #<[object Object]> 

Has anyone decided how to make this kind of interaction?

+4
reactjs react-router clojurescript reagent
source share
1 answer

What reagent-react-router does to make this work use reagent.core/reactify-component . reactify-component exists to make Reagent components valid React components for these kinds of interaction scenarios.

+1
source share

All Articles