This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (11)
- # architecture (2)
- # babashka (84)
- # beginners (226)
- # calva (7)
- # chlorine-clover (4)
- # cider (29)
- # clara (17)
- # clj-kondo (23)
- # cljs-dev (58)
- # cljsrn (60)
- # clojure (172)
- # clojure-europe (24)
- # clojure-finland (2)
- # clojure-italy (6)
- # clojure-nl (8)
- # clojure-spec (4)
- # clojure-uk (22)
- # clojurescript (44)
- # conjure (39)
- # core-async (64)
- # cursive (76)
- # data-science (15)
- # duct (3)
- # emacs (2)
- # events (5)
- # fulcro (30)
- # helix (4)
- # jackdaw (5)
- # juxt (1)
- # kaocha (1)
- # leiningen (4)
- # off-topic (9)
- # pathom (22)
- # re-frame (9)
- # reagent (33)
- # reitit (3)
- # ring (10)
- # ring-swagger (2)
- # shadow-cljs (192)
- # spacemacs (27)
- # specter (2)
- # sql (59)
- # vim (2)
@neo2551 Shouldn't affect re-frame use in any way. Ratoms work the same in function components.
Yeah, the question should perhaps be more "how will the use of React Hooks interact with re-frame"
Yeah. But my view is still that ratoms are already more useful, they can be used outside render call etc.
But hooks could be useful as implementation for some things. Like
useRef could be used to initialize ratoms/subscription once (like subscription deref already works).
useRef you can create mutable object, per component instance, where changes don't automatically trigger re-render.
Just learned about that use for
useRef yesterday myself, @roman01la recommended it for function component implementation instead of
useState where I just had one value I didn't update: https://github.com/reagent-project/reagent/commit/8b365c11dd0cc1e18c9d06a10e0d6d726721e50a
@mikethompson thanks for clarifying my thoughts. It is exactly what I was thinking, hooks provide an additional way of managing state and I wondered whether/how we will manage it with re-frame or otherwise
I strongly suspect that Hooks managing state won't work well with re-frame managing state
I'm trying to like Hooks, i really am :-) But I don't like my views doing anything other than rendering
useState could be used for local state, similar to local
atom for some parts, probably doesn't make sense to use them for application state. And for interop etc.
You can place any value inside of a useState or useRef, no need to convert anything
Should work. I think hx and other wrappers use cljs values with state hooks directly.
@juhoteperi BTW, I'm currently putting together a grownups website for re-frame. When we have it all figured out, maybe we do something similar for Reagent
Yeah I've been thinking about building a new website, and pretty much rewriting all the docs also.
I think Reagent docs at least has good parts, but some of the older pages could be reordered a bit and they are missing some stuff and adding them requires modifying the existing parts.
@neo2551 It is not the contents of the docs that's an issue. Its the presentation.
I wrote a small library for myself that extends marginalia for leveraging mkdocs-material (https://davidpham87.github.io/materiala/)
I think http://calva.io also use it. I found it was nice enough with the search function as well.