Fork me on GitHub
#reagent
<
2019-11-06
>
sudakatux13:11:02

Could someone point me to a tutorial/post or whatver as to how i can use react-hooks in reagent.

sudakatux13:11:05

to reagent. and i managed to get it to render but then their hook fail because of what appears to be the ref function that comes from the TextField

sudakatux13:11:44

My plan then was to implment the same thing using the hook directly but i could not figure out how

David Pham13:11:28

if you create a form-1 function, you could use the react/hook directly

David Pham13:11:34

or you can use hx

sudakatux13:11:05

I was looking into hx but that would mean i have to migrate from reagent to hx right?

p-himik13:11:17

You don't have to. But if you don't have any particular reason to stick to Reagent, you should probably go with pure hx. Otherwise, you can mix them just fine.

sudakatux13:11:34

The reason is re-frame.

sudakatux13:11:09

does hx have something similar?

sudakatux13:11:23

or can re-frame work with hx? somehow

p-himik13:11:32

You can easily wrap hx components to make them Reagent-compatible. Because hx just creates raw React components.

p-himik13:11:37

At least, as far as I remember.

sudakatux13:11:30

cool thanks Ill give that a try

sudakatux13:11:42

and that would mean i cant use re-frame

sudakatux13:11:19

do you have an example of using form-1 and using hooks directly

arttuka13:11:35

you can only use hooks in a react function component, so you can’t use them in any regular reagent component