This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-11
Channels
- # admin-announcements (3)
- # beginners (51)
- # boot (14)
- # cider (55)
- # cljsrn (5)
- # clojure (105)
- # clojure-austin (2)
- # clojure-brasil (3)
- # clojure-dusseldorf (2)
- # clojure-greece (5)
- # clojure-italy (1)
- # clojure-mexico (1)
- # clojure-russia (74)
- # clojure-spec (66)
- # clojure-uk (22)
- # clojurescript (124)
- # cursive (10)
- # datomic (79)
- # events (2)
- # immutant (3)
- # jobs (4)
- # klipse (38)
- # leiningen (2)
- # luminus (1)
- # off-topic (25)
- # om (48)
- # om-next (36)
- # on (1)
- # onyx (19)
- # overtone (3)
- # pedestal (2)
- # proton (3)
- # re-frame (178)
- # reagent (49)
- # ring-swagger (1)
- # spacemacs (10)
- # specter (29)
- # testing (5)
- # untangled (6)
- # yada (65)
@viebel What about (js/ReactDOM.render (your-component {:prop "foo"}) (google.dom/getElement "container-id"))
?
Thx @mavbozo will try it it soon
In my case, it doesn’t work @mavbozo
But I am realizing that my case is very special
I’m adding a container
to klipse
Here is a demo: https://goo.gl/NGAh4Z
When the code contains (require ‘cljsjs.react.dom)
, it breaks
without it is is fine:
Why does the fact that I’m loading react
again (which is a really weird use case) is causing om.next to re-render the components even with shouldComponentUpdate => false
?
If you remove (require ‘cljsjs.react.dom)
, this is what you get
when I load your first link, no "Hello World" rendered, but when I ctrl-enter in the code pane, the "Hello World" rendered
this is exactly the problem
when you re-evaluate the code with ctrl-enter, the bug doesnt reproduce,
because react is not loaded again
@viebel have you tried in Container component to render (dom/div #js {:id "klipse-container-wrapper"} nil)
and fill its children in componentDidMount
?
Trying now...
how would I fill its children?
Is there a way to use om.dom
- inside componentDidMount?
and what will I do inside render()
?
basically, your Container component only knows about dom/div id:klipse-container-wrapper , the inside of the klipse-container-wrapper is outside react control
maybe you could put another react root inside componentDidMount, never tried that before. I use that technique when I embed non-react dom library under react components tree
the Container of the non-react dom library just render the div and in componentDidMount I set up the non-react dom.
It doesn’t work 😞
Because componentDidMount is called again
Exactly
I don’t know if it’s a om.next
bug/feature or react
Anyway, I need a way to prevent it
@anmonteiro maybe you have an idea about ⬆️