Fork me on GitHub
#reagent
<
2019-06-06
>
mafcocinco15:06:07

random newb question: Does Reagent have a dev road map? Specifically, I'm curious what the plans are around React hooks and how they will impact future versions of Reagent.

lepistane15:06:09

there are projects that deal with hooks (hx i think it's called), as far as i know reagent won't be adding them at the moment cause it has much better ways of dealing with state also i heard suggestions to move reagent to native cljs implementation which i kinda like but we will see what happens 🙂

juhoteperi15:06:10

Currently it is hard to use them because Reagent implementation uses React classes (which are incompatible with hooks) and would require large rewrite to use functional components. And I'm not sure if this is possible without breaking existing apps & Reagent API.

mafcocinco15:06:58

A native CLJS implementation (removing the React dependency) would be cool.

juhoteperi15:06:56

Looking at hx and uix, my understanding is that hooks aren't very useful / don't work that well together with Cljs datastructures so it doesn't currently look that important to support them directly in Reagent. (I haven't followed developments very closely so I could have missed some changes.)

👍 4
juhoteperi15:06:10

Specifically, hooks don't currently allow controlling how the value comparison should work with Cljs immutable structures: https://github.com/facebook/react/issues/15154, I think hx and uix implement some workarounds for this

mafcocinco16:06:29

Thanks @juhoteperi and @lepistane. Very helpful and informative.

lilactown17:06:16

FWIW that whole thread was FUD from our end. Hooks work great with CLJS immutable data

lilactown17:06:47

The same concerns we had with CLJS data, are also there for any JS collection (object, array) as well. By following React best practices, we get the same behavior as regular JS data (but with better APIs 😉 )

mafcocinco18:06:22

I may be missing some context here but isn't part of the point that CLJS data is better than regular JS data (i.e. immutable/persistent data structures)? It seems we would want something better than the behavior of regular JS data.