Fork me on GitHub

What are the best ways to work with a UX designer on Reagent apps?


Assuming they do not want to learn ClojureScript?


I thought there were two ways to specify a React key on items in a sequence, but this comment suggests that only metadata is the proper way:


Is that still valid? Why do I see examples of using :key in the first arg passed to a component?


@ajs that look backwards to me. for native elements, you can pass as a key in the props map. for components you have to use metadata.


I guess this stuff didn’t make it into the /docs folder or I can’t find it right now


You can use the metadata approach also for native elements?


Yes I believe so. I put together those docs from old release notes, so there’s a chance something has gone out of date. But yes, I think the metadata approach works for both


@jmckitrick let me know if you figure it out 🙂


@lee.justin.m But check out this custom component (endorsed by Reagent's author) using the key map, not metadata: (for [text ["world" "universe" "multiverse"]] [my-function {:key text} text])


well try it. i don’t think it works. there were some changes to the way component functions worked in 0.4.0, but that happened before that bug was reported so maybe i’m just wrong


i’m pretty sure i tried it before and it didn’t work. i’ve never liked the metadata syntax so i remember trying to avoid it


Seems React 17 will deprecate componentWillReceiveProps. It’s often used to update local state explicitly. The new way of doing this in React 17 will be to implement getDerivedStateFromProps and return the new state in that function. I’m just wondering how this will affect Reagent? I’m always using a ratom and a form-2 component for storing the local state instead of using React’s own state.


i’m pretty sure reagent manages its own updates and does not depend on react’s state system. componentWillReceiveProps only appears in one place in the code base and that is just to wrap a user’s form-3 component


Cross posting this from cljsjs channel (since that seems largely a bot log): Hey all, anyone willing to bump the cljsjs semantic ui react to v0.79? (


this is where i feel smug about using shadow-cljs 😛


@lee.justin.m haha i mean, it sounds like there is definitely reason to be 😆 Trying out shadow-cljs is on my 'todo list' (along with things like trying


its so nice to just yarn add whatever-npm-i-damn-well-please and then just include it

Alex H20:04:07

yea, I'll second that. shadow-cljs is the only reason I'm using clojurescript, pretty much - otherwise I'd have given up a long time ago