I have a simple Om.next app:
(def app-state (atom {:key-a "foo" :key-b "bar}))
(defui Child
static om/IQuery
(query [this]
[:key-a :key-b])
Object
(render [this]
(let [{:keys [key-a key-b]} (om/props this)]
(dom/p nil (str "a is " a ", b is " b)))))
Using the trivial reader (mapping keys directly to state), I can render this
fine:
(om/add-root! reconciler Child (gdom/getElement "app"))
Now I'm trying to wrap it inside a Parent component, which will become the
container and include other children:
(def child (om.next/factory Child))
(defui Parent
static om/IQuery
(query [this]
(om/get-query Child))
Object
(render [this]
(child (om/props this) nil)))
(om/add-root! reconciler Parent (gdom/getElement "app"))
This breaks; the query triggers what appears to be this error:
https://github.com/omcljs/om/blob/c71b8e2ba094b193ab4052082d0ebdc0cdd91952/src/main/om/next.cljc#L704
However, if I swap the query in the Parent to the literal query from Child:
(defui Parent
static om/IQuery
(query [this]
[:key-a :key-b])
;; render as before)
Everything renders correctly.
What does this error mean, and why am I getting it, when it appears that
`get-query` returns the same value that I'd have when I pass it in literally?
--
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 https://groups.google.com/group/clojurescript.