This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-04-24
Channels
- # ai (41)
- # announcements (4)
- # babashka (14)
- # beginners (24)
- # calva (7)
- # clj-kondo (36)
- # cljsrn (4)
- # clojure (68)
- # clojure-austin (2)
- # clojure-europe (39)
- # clojure-nl (2)
- # clojure-norway (37)
- # clojure-uk (2)
- # clojurescript (7)
- # clr (8)
- # community-development (16)
- # core-async (7)
- # datalevin (67)
- # fulcro (11)
- # helix (1)
- # honeysql (2)
- # london-clojurians (2)
- # off-topic (60)
- # pedestal (3)
- # portal (2)
- # practicalli (1)
- # re-frame (7)
- # reitit (49)
- # releases (3)
- # shadow-cljs (2)
- # xtdb (16)
I need to access fulcro’s reactRoot
, is there any current api for that? I need it for fulcro support in the portfolio lib.
I added it to the with-react18
function => (assoc ::reactRoot reactRoot)
let me know if I can open a PR for that or not. Maybe I’m missing something obvious.
I’ll have a look. There is already the concept of react root, but I wasn’t sure if the new version was compatible with the old.
Sure Tony, thanks. I opened a PR, let me know if you think there’s some other way around that makes more sense.
Hey guys, how can I do this with fulcros built in templating instead of hiccup
In the fulcro-rad-demo
there’s this line adding the csrf token
[:script (str "var fulcro_network_csrf_token = '" csrf-token "';")]]
I want to do that with fulcros built in templating
with [com.fulcrologic.fulcro.dom-server :as dom]
`(dom/script
(str
“var fulcro_network_csrf_token = ‘” (get props :csrf-token) “’;“)))`
but the quotes get escaped and I get this in the browser
var fulcro_network_csrf_token = '2rqljB6myiy477nNoXk6QpqxPG0CjFlz1tNZXDFA2le/a3seAP+AFnBBkwlC9idS0yIAzeUPNJ2bmb88';
How can I put javascript in the dom/script tag?
did you try to escape the quotes like this: \"
?
yes, in that case it prints " in js
you can also use '
single quotes, they work the same as double quotes in javascript
The server-side rendering support is not meant for general use as a server HTML generation library. It is meant to act as a way to get a DOM that react can accept. React, in general, does NOT want you to embed js this way (see dangerouslySetInnerHTML). This is why I use a server-dedicated library (hiccup) to generate these.