This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-28
Channels
- # aleph (1)
- # arachne (4)
- # beginners (13)
- # boot (18)
- # clara (7)
- # cljs-dev (156)
- # cljsrn (278)
- # clojure (163)
- # clojure-conj (5)
- # clojure-dev (1)
- # clojure-losangeles (1)
- # clojure-poland (2)
- # clojure-sg (1)
- # clojure-spec (15)
- # clojure-uk (17)
- # clojurescript (275)
- # data-science (5)
- # datomic (23)
- # emacs (10)
- # leiningen (1)
- # lumo (16)
- # off-topic (98)
- # onyx (10)
- # parinfer (83)
- # re-frame (18)
- # reagent (47)
- # remote-jobs (1)
- # ring (1)
- # ring-swagger (5)
- # rum (6)
- # specter (8)
- # vim (5)
@mrchance that's a common problem
it means that you have multiple versions of React in your project
this could be for a variety of reasons
are you using a lib packaged on cljsjs?
these sometimes inadvertently bundle a version of react
Hi, no, I am reasonably sure that's not the reason. npm ls react
shows only one version, and I am not using any cljsjs dependencies
I'll bet you EUR 10 that's the problem
If I don't use the tabs, but other react bootstrap components I also don't get the error
are you using webpack?
"dependencies": {
"react": "^15.2.1",
"react-bootstrap": "^0.31.0",
"react-codemirror2": "0.0.9",
"react-dom": "^15.2.1"
}
that's an awfully old version of react
try updating to 15.4.2
well reagent comes with a dependcy on react
did you exclude that?
try lein deps :tree
[reagent "0.6.1"]
[cljsjs/react-dom-server "15.4.0-0"]
[cljsjs/react-dom "15.4.0-0"]
[cljsjs/react "15.4.0-0"]
You might be right 🙂try adding
:exclusions [cljsjs/react cljsjs/react-dom cljsjs/react-dom-server]
to your project.clj as a top level keyyou'll also need to add surrogate namespaces
^^ updated
this is not about different versions
I think
it's about two instances of react coexisting in the same js runtime
basically you need these empty .cljs files so that the cljs compiler won't complain that the nss are missing
ah, ok... Maybe it's a better idea to just use the cljsjs versions of react in the rest of the code then? Or does that not work because codemirror will bring their own?
that's right, it probably won't work
Ok, I'll try that later, thanks for the help. I'll probably need your paypal, just in case 😉
you may also need to do something like window.React = require("react"); window.ReactDOM = require("react-dom");
... before reagent get loaded, so that reagent can find the npm provided version of react
yeah it's a bit of a song and dance
isn't there a cljs electron template that does this for you?
I used this one as inspiration https://github.com/Gonzih/cljs-electron