The new :f>
seems great!
I wonder how it will interact with re-frame.
@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"
Because Hooks offers a different "state management" model
Yeah. But my view is still that ratoms are already more useful, they can be used outside render call etc.
Yes, I absolutely agree
I was just suggesting the that issues would be elsewhere
Ie. :f>
will work fine with re-frame. But the Hooks within them might not
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).
Yep, I'm probably thinking more of useState
etc
Is that the name?
With useRef
you can create mutable object, per component instance, where changes don't automatically trigger re-render.
I'm going to look that up now
I'm trying to get up the Hooks learning curve
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.
I haven't tested it yet: but can we useState
with a CLJS value?
You can place any value inside of a useState or useRef, no need to convert anything
Or will it get round-tripped via clj->js
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 thought all your docs were really good for both projects.
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.
@neo2551 yeah, we're going with mkdocs
Shared from shadow-cljs channel β¦ perhaps itβs more a reagent topic.