This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-04
Channels
- # aleph (1)
- # aws-lambda (2)
- # beginners (30)
- # boot (2)
- # cider (7)
- # cljs-dev (65)
- # clojure (130)
- # clojure-denmark (1)
- # clojure-france (1)
- # clojure-germany (2)
- # clojure-greece (1)
- # clojure-italy (19)
- # clojure-kc (2)
- # clojure-nl (12)
- # clojure-poland (1)
- # clojure-russia (11)
- # clojure-spain (1)
- # clojure-spec (20)
- # clojure-uk (176)
- # clojurescript (65)
- # css (3)
- # cursive (8)
- # datomic (26)
- # editors (94)
- # emacs (10)
- # fulcro (66)
- # graphql (5)
- # midje (1)
- # off-topic (48)
- # om-next (2)
- # overtone (1)
- # re-frame (15)
- # reagent (6)
- # reitit (10)
- # shadow-cljs (68)
- # sql (3)
@souenzzo here is my approach for using material-ui’s CSS-in-JS with Reagent: https://gist.github.com/mhuebert/4e3af2fbc33b40e74539487e50110a14
I wrote a let
macro which delegates to a wrapped version of withStyles
, which I find succinct and readable:
(:require [material-ui.styles :as m])
;; ...in a component somewhere
(m/let [{:keys [leftPad]} (fn [^js theme]
{:leftPad
{:paddingLeft (.. theme -spacing -unit)}})]
[my-component {:class leftPad} ...])
Has anyone played with or know how (or if) I could integrate https://css-blocks.com/ with a reagent project?
Hey, I can't find resources on testing reagent code. Could someone point me to something or tell me how this would work?
I have never actually testing my Reagent code via code - I just test it by hand in the browser. But I have some ideas: • You can write most Reagent component pieces as pure functions and test the Hiccup-like return values • You may be able to use a JS React testing library like https://jestjs.io directly (not sure if CLJS has a wrapper, but I couldn't find one) • Write state changing code in separate functions from your Reagent components and unit/integration test the functions • Not really related to Reagent, but I found this for Om-Next: https://github.com/omcljs/om/wiki/Applying-Property-Based-Testing-to-User-Interfaces ... Might be something to learn from (didn't read through it all) • There is also Selenium which has been around for a while and applies to generic website testing (https://docs.seleniumhq.org/) Hope that helps a little
I don't write unit tests for reagent. I am testing it using webdriver protocol via https://github.com/igrishaev/etaoin.