0

I'm developing a tree menu using Om Next by nesting multiple instances of the same component ((defui Tree...). I can recursively build the tree by passing different properties, so the initial rendering is fine.

But, re-rendering items upon the state change is problematic since they share the same query and the params. But, if I can have different query parameters in different component instances they will be served with appropriate properties.

My understanding is, the query and the parameters are linked to the Component rather the individual instances. Therefore, trying to update parameters using om-next/set-query! didn't work here.

What is the idiomatic way of handling such a scenario? Can we do a workaround with om/factory?

(Please pardon me if I'm suffering from a misunderstanding of fundamentals here.)

Tharaka
  • 2,883
  • 1
  • 21
  • 13
  • 1
    Does this help: http://book.fulcrologic.com/#_recursive_queries. It is the same for Om Next as Fulcro I believe. – Chris Murphy Aug 24 '18 at 01:34
  • It is very similar. But it is not addressing the exact issue yet. Thank you Chris! – Tharaka Aug 24 '18 at 02:29
  • 1
    I stayed away from both `setQuery` and query parameters, thinking they were not really necessary, and too difficult to reason about and work with. – Chris Murphy Aug 24 '18 at 03:36
  • Yeah, probably I should step back find an alternate path. But if the framework allowed this, it would be really handy. – Tharaka Aug 24 '18 at 04:06

0 Answers0