@briantrice I personally prefer working on components and portions of the UI in a devcard with :inspect-data true. This is also made a bit easier if you use the trick from Fulcro of InitialAppState co-located with components.
because then it is easy to factor the thing into pieces and embed them…well, in stock Om Next, the parser can make that a bit difficult I guess, unless you’re mostly using db->tree
is it possible to have completely dynamic queries with om.next? i need to calculate my query based on props
om/set-query!
is close, except the parent component still causes the child to render without the query data
@cjhowe I tried and had a lot of problems with dynamic queries when starting out with om.next. What I tried to do was to use the this
passed to om/IQuery (query [this])
to check if it's a component, get the props and do what I wanted. This approach never worked because of how the indexer worked at the time.
Another thing I tried to do to get dynamic queries was om/set-query
which, as you mentioned, has problems.
What I recommend "dynamic queries" is to do union queries for all your cases and "choose" the join (or joins) in your union query depending on your app-state at read time.
@tony.kay oh! I’m still new to this ecosystem and have only heard the word “devcard” and not gotten my lein cljsbuild to deliver them. I’ll see again
@briantrice So, try out the fulcro template at https://github.com/fulcrologic/fulcro-template. It’s a fully-working project that also includes devcards. Fulcro was renamed from Untangled, and there are some videos on the old name that demonstrate what I’m talking about. This on in particular should be of interest to you: https://youtu.be/uxI2XVgdDBU?list=PLVi9lDx-4C_T_gsmBQ_2gztvk6h_Usw6R
oh! okay. I’ll make a checkout and tinker with it soon
I'm on om.next and having quite a bit of trouble with some Material UI text edit fields. Every edit moves the cursor to the end of the field. I found React issues about this, but, AFAICT, om.next prevents the React work-around.
Anyone know about this?
@eraserhd Make sure you’re properly setting your react-key to avoid re-renders.
Sounds like the backing component is being re-mounted on every keystroke.
The :key
property, you mean?
This is definitely being set correctly. Just double-verified.
Here is the React issue: https://github.com/facebook/react/issues/955
If I use :defaultValue
instead of :value
, it works!