Hi David,

thanks for your help.

On 18 Jan 2014, at 01:47, David Nolen <[email protected]> wrote:

> (apply dom/p nil
>   (map render-subdiv (:subdivs data)))
> 
> Is not going to work. You need to put the result of map into a JavaScript 
> array. React doesn't know anything about ClojureScript sequences and I don't 
> expect it to for some time and I don't intend to magically making that work 
> in Om in the near term.

Unfortunately, if I change the fn main-div to the following:

(defn main-div [data owner]
  (om/component
   (dom/div nil
            (dom/h1 nil (:title data))
            (dom/p nil
                   (into-array (map render-subdiv (:subdivs data)))))))

Then I still see the same error - i.e. it renders correctly initially, then the 
timer triggers the exception described previously.

The mistake I was making before was treating the dom/* macros as functions - 
which was why I was trying to apply them to a Clojure sequence. I hadn't looked 
closely enough at the bottom of the dom ns where gen-react-dom-inline-fn 
generates a macro for the specified tag and the function-producing 
gen-react-dom-fn isn't ever called.

I must therefore clearly be doing something else wrong. The strange thing to me 
is that it does work for the first render - it just can't handle the state 
being modified.

Sam

---
http://sam.aaron.name



-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to