Fork me on GitHub
#reagent
<
2018-11-22
>
y.khmelevskii19:11:43

got it. A few weeks ago React announced a lot of new features and it would be great to use them in cljs world. For example, useContext, useEffect, useImperativeMethods would be very useful. I think Reagent should do a lot of work to adapt to these React changes, but I’m not sure if it’s possible 😞

lilactown19:11:10

I actually have an experimental library https://github.com/Lokeh/hx that I’m working on as a way to essentially replace reagent with raw React + Hooks

👍 1
lilactown19:11:42

I have an open PR for additional syntax and convenience functions for using Hooks with it, but here’s a demo using the new Hooks API without all of that: https://github.com/Lokeh/hooks-demo

y.khmelevskii20:11:31

Thank you @U4YGF4NGM! I will investigate it. I think that using new approaches for building react components it’s a correct way. The last react features designed to improve app performance (time slicing, etc)

lilactown19:11:25

it’s not currently. reagent creates React classes. the new Hooks API only works in functional components

lilactown19:11:25

I actually think that React.lazy might be quite a bit easier, since it only relies on Suspense being enabled