This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-16
Channels
- # announcements (3)
- # beginners (104)
- # boot (18)
- # calva (1)
- # cider (43)
- # cljs-dev (45)
- # cljsrn (2)
- # clojure (29)
- # clojure-dev (10)
- # clojure-europe (2)
- # clojure-italy (117)
- # clojure-nl (17)
- # clojure-spec (56)
- # clojure-uk (41)
- # clojuredesign-podcast (12)
- # clojurescript (35)
- # community-development (6)
- # cursive (27)
- # datomic (12)
- # emacs (9)
- # fulcro (6)
- # graalvm (52)
- # instaparse (6)
- # klipse (3)
- # leiningen (11)
- # lumo (1)
- # off-topic (16)
- # pathom (31)
- # re-frame (10)
- # reagent (26)
- # reitit (3)
- # shadow-cljs (67)
- # sql (4)
- # tools-deps (1)
@jo.chasinga to give you your first hint, i remember that to use a react component you can use [:> ReactComp {...props...} ...children...]
Thank you! Can you please expand on that a little?
Do you remember how to import that reagent component from a jsx module?
thank you
Hmmm, I have a question about SPA, not specific for reagent. On mobile safari, user can use swipe gesture to forward/back. that make my page flicker, how can I avoid this?
i wanna use the react component react-sidebar
. My problem is that the styles are passed to props as an object (https://github.com/balloob/react-sidebar#styles).
it's possible to do this in reagent ?
React:
styles={{ sidebar: { background: "white" } }}
A sort of unusual question: is there a way to update a reagent atom within a component without triggering a re-render?
For anyone interested you can do:
(binding [reagent.ratom/*ratom-context* nil]
;; Deref here
)
@dpsutton I solved it (see my thread comment) but my use case was some interop w/ an existing reagent library where I was creating a one-off instance of something that validated but stored in an ratom, which caused a loop when I would call my fn inside of render
the whole ratom machinery is a black box and the *ratom-context*
is def an implementation detail
@ivangalbans When using adapt-react-class
the first argument is the props. See: https://reagent-project.github.io/docs/master/InteropWithReact.html
@UM9SV1LE8 yes, you are right.
But I am asking for the particular props styles
. I don't see any examples of this.
The problem is how you pass custom styles to the props.
In react you can do:
styles={{ sidebar: { background: "white" } }}
But in reagent you expect to do:
{
:styles {:sidebar {:background "white"}}
}
I don't know, something like this
I explained well my problem now ?I'm pretty you should just be able to use your expected example, with the one caveat that you'd need to convert it to a javascript object first via clj->js
.
yep, I forgot clj->js