Fork me on GitHub

Anyone else having laggy text-input data entry using reagent? I’m not even doing a roundtrip to re-frame and I’m getting errors like this:

YellowBox.js:67 Native TextInput(Asdfasdf) is 4 events ahead of JS - try to make your JS faster.
(defn simple-text-field []
  (let [current-value (r/atom nil)]
    (fn []
      [text-input {:onChangeText #(reset! current-value %)
                   :value        @current-value


Then again, maybe it’s just my iOS simulator? Everything seems to be running slowly.


I’m trying to install boot-react-native as per "”, but crashes on boot inst:

clojure.lang.ExceptionInfo: No such task (inst)
    data: {:file
           :line 21}
java.lang.IllegalArgumentException: No such task (inst)
          boot.core/construct-tasks  core.clj:  905
                 clojure.core/apply  core.clj:  630
                  boot.core/boot/fn  core.clj:  949
clojure.core/binding-conveyor-fn/fn  core.clj: 1916


@seantempesta: replace :value with :defaultvalue


@misha I tried that, but then I couldn't update a field that was focused. I ended up doing it the react way and used their setState method using :value. Not sure why it's so janky with reagent.


@sineer @levitanong fwiw last night i did a PoC - i couldn't integrate compassus but i totally stole the idea and re-implemented routing with union queries (no add-root! or set-query! neeeded), it totally works, as a quirk you need to implement the NavigatorExperimental reducer yourself, and basically take care of keeping state/real navigation in sync yourself, but the advantage is massive (no need for nested navigation queries either)


@dzannotti nice! can you put up a repo so we can take a look and learn from you? 😄


yeah give me a day or two to clean the code up, it's a total tangled mess atm


(tbh nothing to learn, i'm super noob at om-next)


@seantempesta if you wrap text-input in a component, and have a changing atom above that component - :defaultValue works much faster.

(rum/defc input [v on-change]
  (text-input {:defaultValue v :onTextChange on-change}))

(rum/defcs user-name > (rum/local "" ::txt) [state]
  (let [txt (::txt state), on-change #(reset! txt %)]
    (input @txt on-change))


:value stutters not only in reagent.


@dzannotti I look forward to see what you have done 🙂 I read Compassus code last night and brainstormed how to integrate with @exponent/ex-navigator and I think I have a way to do it, I'll keep you posted on progress I make later this eve..


@sineer nothing special, it's a similiar approach to compassus pretty much (union queries with a fixed root component pretty much)


did you integrate with ex-navigator and have drawer (stack-nav drawer--nav-item...) ?


My latest approach is to build a "Compas" Om component init compassus in state and render the nav-provider and feed it a filtered compassus route->component map so that it (Compas) can route using compassus and in the mutation fn set call the nav-provider push/pop "under the hood"... This way I get to use ex-navigator drawer-items with multiple stack-nav and get compassus to drive them stack-nav(s).


i didn't integrate the drawer no, but i did write the route->component part yeah