reagent icon indicating copy to clipboard operation
reagent copied to clipboard

Make possible to reactify-component to return a functional component

Open m-lce opened this issue 4 years ago • 1 comments

I did not found any way to make reactify-component return a functional component. Even if I use it with a functional compiler like this :

(def functional-compiler (reagent.core/create-compiler {:function-components true}))
(defn reagent-cmp
[props] 
[:> rn/Text "Hello]" )
(def react-cmp (reactify-component reagent-cmp functional-compiler))

react-cmp will no be a functional component. We can use as-element in the reagent-cmp and use the function as a react component but this prevent us to use ratom inside.

Will it be possible to add an option to make reactify-component return a functional component ?

Thanks

m-lce avatar Sep 17 '21 08:09 m-lce

This is a bug, I've forgotten to implement the function-components case for reactify-component. It should be possible to implement this using the existing API.

Deraen avatar Dec 19 '21 14:12 Deraen