Fork me on GitHub

Can anyone tell me why I get "No queries exist for component path (mx.core/MainView mx.core/NavView)”) if I just pass all props to nav-view at line 53 (i.e. (nav-view (om/props this)) instead of pulling out the current tab and passing it in as I’ve done?


@lgastako: The props returned from om/props contains metadata that has the path from the root that lead to the component. Queries also contain metadata that refers back to the component and is used to create the path. Since your MainView query doesn't refer to NavView's query, then the reconciler can't work the query backward to do the indexing. Pulling the props out and creating a new map elides the metadata and so om doesn't try to reconcile the query backward.


@lgastako: disclaimer, that response includes a lot of guessing and conjecture


@cmcfarlen: thanks… that makes sense at a high level, but what would I need to do to refer to NavView’s query in MainView so that it could work the query backwards? Both views already use the same query?


Since the query is the same, perhaps just have MainView and create a function that just returns the sablono vector and pass it the props. Then not have the NavViews component.


If you want it to be a component, you can nest the query: [{:nav (om/get-query NavView)}]


The example code was extracted from a more complicated case in real life, but I’ll meditate on this and see if I can work out the “right” way to do it for my case. Thanks again.