Skip to content

reagent render Input dosen't support Chinse and cursor doesn't perform well #444

@kangbb

Description

@kangbb

version

  • 0.8.1

What I do

I use reagent.core/create-class to create a Component Class with some React Native UI Component, including TextInput. And the render state is reagent own, which is .-cljsState.It works correctly with English, but I can input Chinese. This is the code snippet:

(defn page []
  (r/create-class
    {:get-initial-state (fn [this]
                                 (set!  (.-state this) {:search ""}))
     :render (fn [this]
               [:> rn/View
                [:> rn/TextInput {:placeholder "Search"
                                  :getInitialState (fn [this]
                                                     (set! (.-state this) {:search ""}))
                                  :onChangeText #(reset! (.-cljsState this) {:search %})
                                  :value (:search @(.-cljsState this))}]])}))

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions