This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-05
Channels
- # all-the-channels (1)
- # announcements (3)
- # asami (13)
- # beginners (227)
- # calva (2)
- # chlorine-clover (8)
- # cider (7)
- # clj-kondo (4)
- # cljs-dev (21)
- # cljsrn (8)
- # clojure (64)
- # clojure-europe (39)
- # clojure-france (2)
- # clojure-italy (3)
- # clojure-losangeles (1)
- # clojure-nl (20)
- # clojure-uk (8)
- # clojurescript (24)
- # conjure (12)
- # datalog (9)
- # datomic (24)
- # emacs (8)
- # figwheel-main (1)
- # fulcro (15)
- # jobs-discuss (1)
- # malli (5)
- # meander (3)
- # off-topic (26)
- # re-frame (15)
- # reagent (10)
- # reitit (1)
- # reveal (1)
- # sci (15)
- # shadow-cljs (25)
- # spacemacs (7)
- # sql (3)
- # xtdb (1)
@quoll I can't remember how that ended up in Clojure, @alexmiller would know - if it's intentional then that fix just hasn't been ported over
I wasn’t sure if I could look in a transient map, but it appears that I can. I’ve been doing some testing on it, and it’s reliable for large numbers of keys (both Clojure and ClojureScript). (Yes, I know I need to look at the sources and not rely on empirical testing) But the transient approach is certainly faster for loading a lot into the map, so that’s why I’m trying to stick with it.
i'm trying to translate material-ui js samples to cljs as a first time front end writer https://material-ui.com/components/buttons/#buttons-with-icons-and-label say:
<Button
variant="contained"
color="secondary"
className={classes.button}
startIcon={<DeleteIcon />}
>
Delete
</Button>
and my best guess cljs equivalent is:
(defn add-thing-button [{:keys [^js classes]}]
(fn []
[:> Button {:classes (.-button classes)
:variant "contained"
:color "primary"
:on-click #(rf/dispatch [:add-thing/open-dialog])
:startIcon icons/Add ;; <- refuses to render
}
"Add Thing"]))
(defn add-thing-button-widget [kv]
[:> (with-styles
(reagent/reactify-component
(add-thing-buton kv)))])
The :startIcon refuses to render no matter how i package it. What noob error am I making? Any help appreciatedr/as-element or better :startIcon [:> icons/Add]
you see here that <DeleteIcon />
is an instance of element but not symbol of class/function-component.
thanks for the reply. when i try :startIcon [:> icons/Add]
i get a blank page but no errors in the console.
sorry, Im bit rusty, it's a prop so it wont be passed trough to reagent directly, you'll need to call some reagent function on this. I recommend reading the interop parts of the reagent documentation https://cljdoc.org/d/reagent/reagent/1.0.0-alpha2/doc/tutorials/interop-with-react
r/as-element sounds right to me
after reading the linked doc and sample, create-element
turned out to be the answer. Thanks all
Does anyone have any experience with the new Web Animations API? How do you use it with reagent, or re-frame, or at all? ^^ https://web.dev/web-animations/
uhm weird I'm trying to use the cljs-ajax library in a cljs file, and the same exact code works fine in CLJ but doesn't do anything in CLJS, simply returning this but never actually calling the handler function
#object[Object [object Object]]
ah right it's just
has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I should have checked the console beforeI’m late to the party, but I wanted to say… I haven’t looked at Quick-Start for a while, and just went through it now. I’ve been working with ClojureScript command line repls for a while, but I am blown away at how smooth and easy it is now. I’m not sure who else was involved, but I can see it was documented by @dnolen. Thank you!
@quoll there's a good amount of feedback about it so the credit goes to everyone that tried it out
that said, it was driven driven by finally losing patience with all the scripting to do the most basic things
Am reading the clojurescript FAQ for JS devs and saw "You can also write functions in ClojureScript and call them from JavaScript." Was just wondering, is there a good way to incrementally convert a JS codebase to Clojurescript? Or must it be a complete overhaul? :o
@zackteo you can create a "helper" namespace in cljs, and pull it into your js module
migrate functions one by one into the helper, until the helper replaces the thing that uses it
you should be able to move one fn at a time, and you might not even need to rewrite any tests :D