Fork me on GitHub
#reagent
<
2015-07-13
>
escherize12:07:32

Oh that author looks familiar! Thanks @borkdude!

Petrus Theron14:07:38

I'd like to make a reusable focused function that calls .focus on a component's root element. So I made this:

(defn focused [comp]                                     
  (with-meta comp
    {:component-did-mount #(.focus (dom-node %))}))
which I think should be usable as [(focused text-input) model], where text-input is an [:input {:type "text" :value @model :on-change #(reset! model (e->value %)}. However, I'm having trouble passing in the model argument to the wrapped component. Any ideas how to do this?

roberto14:07:44

hmmm, is it possible to have focused return a function?

roberto14:07:18

if you want to pass an arg, I believe the output of focused should be a function

mhuebert14:07:32

I often see error messages from util.cljs, coming from inside render-component. Is there a way to see more specifically where those errors come from?

Petrus Theron19:07:29

Added [re-com "0.5.4"] dependency and getting this error: clojure.lang.Compiler$CompilerException: java.lang.IllegalArgumentException: No single method: _setup of interface: cljs.repl.IJavaScriptEnv found for function: -setup of protocol: IJavaScriptEnv, compiling:(cemerick/piggieback.clj:149:5). I have [org.clojure/clojurescript "0.0-3308" :scope "provided"] set and boot is using Clojure 1.7 to build.

mikethompson23:07:08

@petrus: I saw someone having an issue with re-com and boot because the clj-time used by re-com was out of date, or something. Only a vague memory.