Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make possible to reactify-component to return a functional component #548

Open
m-lce opened this issue Sep 17, 2021 · 1 comment
Open

Make possible to reactify-component to return a functional component #548

m-lce opened this issue Sep 17, 2021 · 1 comment
Labels

Comments

@m-lce
Copy link

m-lce commented Sep 17, 2021

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

@Deraen Deraen added the bug label Dec 19, 2021
@Deraen
Copy link
Member

Deraen commented Dec 19, 2021

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.

zampino added a commit to nextjournal/clerk that referenced this issue Jun 29, 2023
components using hooks not working because of this bug reagent-project/reagent#548
zampino added a commit to nextjournal/clerk that referenced this issue Jun 29, 2023
components using hooks not working because of this bug reagent-project/reagent#548
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants