This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-13
Channels
- # aleph (2)
- # announcements (1)
- # beginners (133)
- # cider (29)
- # cljdoc (9)
- # cljs-dev (2)
- # cljsjs (3)
- # cljsrn (1)
- # clojure (146)
- # clojure-dev (26)
- # clojure-europe (3)
- # clojure-italy (26)
- # clojure-japan (6)
- # clojure-nl (76)
- # clojure-spec (4)
- # clojure-uk (42)
- # clojurescript (17)
- # cursive (43)
- # datascript (1)
- # datomic (28)
- # emacs (4)
- # figwheel-main (13)
- # fulcro (26)
- # hyperfiddle (2)
- # jobs (9)
- # jobs-discuss (6)
- # leiningen (1)
- # mount (5)
- # onyx (8)
- # pathom (5)
- # pedestal (2)
- # re-frame (52)
- # reagent (21)
- # reitit (58)
- # ring-swagger (24)
- # shadow-cljs (95)
- # sql (14)
- # test-check (10)
- # yada (18)
Is there a way to check the version of react reagent is running? In React you can just do React.version
. Is there something like this for reagent?
Just use JS interop: js/React.version
I’m not sure this would verify what I was trying to prove to myself. If I have a webpack bundle with React
in it, not the one installed when you install Reagent
, it becomes the global React
instance. So This would not tell me which one is which.
I don't know either. But it is exactly what you gave in 'In React you can just do React.version
'.
if you're using figwheel I think it automatically installs a certain version, but you can override it
I am looking for the version of React that Reagent is currently using. The issue is I am experimenting with my build and want to make sure Reagent is using the version I expect it to
so you want to know which version of React you have installed. can you not do React.version
in your console?
Yes, but at the moment, I am testing in a node environment so I was hoping for something like reagent.react-version
again, Reagent will use whatever version of React is installed. it simply references the global namespace
in a namespace, you could do:
(ns my.thingy
(:require ["react" :as react]))
(js/console.log react/version)
and see what it outputsI think that should work either way. if not, remove the quotes around the first react
in that require
I am using figwheel. Right now I have a version of React installed in my node_modules
and I have set my npm-deps false
but I want to make sure Reagent is not using the version of React from node_modules
The reason for this is because I am setting up Jest for Reagent tests (experimenting). So I have a webpack bundle which includes react, react-dom, create-react-class and react-test-renderer
because react-test-renderer
needs these 3 deps.
I think that requiring react into a namespace and printing the version should do what you want
Thanks, that helped. For future reference for those interested:
; reagent version of react
(:require ["react" :as react]))
(js/console.log (.. react-reagent -version)
; reagent version of react
(js/console.log (.. js/reagent -impl -template -global$module$react))
; node_modules react
(js/console.log (.. js/demo -my-component-name -global$module$react -version))
All work, the second 2 are ugly and nothing I would do in production, but I was able to verify. Thanks again!Just use JS interop: js/React.version