This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-04-01
Channels
- # beginners (28)
- # cider (39)
- # cljs-dev (2)
- # cljsjs (1)
- # clojure (67)
- # clojure-conj (1)
- # clojure-dev (103)
- # clojure-gamedev (3)
- # clojure-uk (2)
- # clojurescript (46)
- # data-science (7)
- # datascript (1)
- # fulcro (5)
- # lein-figwheel (2)
- # mount (2)
- # off-topic (55)
- # portkey (7)
- # protorepl (11)
- # re-frame (45)
- # reagent (21)
- # shadow-cljs (34)
- # tools-deps (3)
- # vim (8)
- # yada (1)
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: https://stackoverflow.com/questions/33446913/reagent-react-clojurescript-warning-every-element-in-a-seq-should-have-a-unique#comment54706823_33458370
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. https://gist.github.com/jmlsf/17c588deb326e538dcea6847bc66db9b#keys
I guess this stuff didn’t make it into the /docs folder or I can’t find it right now
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.
Btw, source: https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#updating-state-based-on-props
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? (https://github.com/gadfly361/soda-ash/issues/7)
@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 https://github.com/nervous-systems/cljs-lambda)