This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-01
Channels
- # bangalore-clj (1)
- # beginners (16)
- # bigdata (1)
- # boot (16)
- # cljs-dev (79)
- # cljsjs (37)
- # cljsrn (62)
- # clojars (1)
- # clojure (260)
- # clojure-austin (3)
- # clojure-dev (3)
- # clojure-dusseldorf (3)
- # clojure-italy (1)
- # clojure-russia (32)
- # clojure-serbia (2)
- # clojure-spec (8)
- # clojure-uk (146)
- # clojure-ukraine (16)
- # clojurescript (66)
- # cursive (27)
- # datomic (57)
- # dirac (124)
- # emacs (10)
- # hoplon (12)
- # juxt (6)
- # keechma (6)
- # lein-figwheel (18)
- # leiningen (6)
- # lumo (51)
- # off-topic (1)
- # om (66)
- # onyx (41)
- # perun (1)
- # play-clj (1)
- # protorepl (9)
- # re-frame (20)
- # reagent (11)
- # ring (4)
- # ring-swagger (10)
- # rum (22)
- # specter (8)
- # sql (2)
- # test-check (5)
- # untangled (27)
- # yada (29)
> Is there any issue with putting arbitrary functions on the internal rum state? No, put whatever you want
I have to wrap my head around rum a little... so, if I want to add an existing react component (https://github.com/FineUploader/react-fine-uploader)... how to make that happen properly in rum?
or would it be better to use the base js implementation?
@rauh thx...
ok... so,
1. I install the 3rd party react component with npm - it ends up in ~/node_modules
.
2. I define:
(defn upload-el []
(js/React.createElement js/Gallery
#js {}))
3. ...?
If I run after step 2, I get:
Uncaught ReferenceError: Gallery is not defined
at [...]$upload_el (upload.cljs:4)
at [...] (app.cljs:17)
at init1447.cljs:2
at Object.G__10460__delegate (reload.cljs:53)
at Object.G__10460 (reload.cljs:53)
at goog.async.Deferred.fire_ (deferred.js:649)
at goog.async.Deferred.updateResult_ (deferred.js:298)
at goog.async.Deferred.continue_ (deferred.js:282)
at goog.async.Deferred.fire_ (deferred.js:649)
[...]
rum looks for that react element (and not react), and obviously, can't find it...... or how can I make rum find the react component (I'm using boot as build tool, it it matters 🙂 )
@kurt-o-sys installing packages straight from npm is still very much an experimental thing. In the immediate term you’re most likely better of checking cljsjs and publishing a package there
You could also fork the project, set it up to build to UMD, copy and paste the UMD file into your resources, then put a reference to it in :foreign-libs
The only other issue is externs. So you could :infer-externs
, see if that covers your cases. Or you can manually write them.
ok... let's see: to use a react component, I can: 1. try to make a cljsjs package (never done it before) 2. fork, build to UMD, copy-paste, put in :foreign-libs I guess I'll try the first one; both need finding the interns etc, so well, I have to give it a shot, I guess. See how hard it is 😛.
yeah... would be much nicer for react components.
There’s also https://clojurescript.org/guides/javascript-modules Look at the last section if you haven’t already
oh, that may make sense... let me try this 😛