Skip to content

ViewManager is different between iOS and Android, why? #5139

@GitMaYi

Description

@GitMaYi

When I use EditText, I need a function to tell js how many numbers before cursor:

  • In iOS, i can use @ReactMethod to give JS a callback in ReactTextInputManager cause ViewManager is a Module
  • In Android, js invoke ViewManager's method by override getCommandsMap() and receiveCommand() in custom ViewManager. The problem is this way can't pass a callback. So the solution is I use a JavaScriptModule, like RCTEventEmitter, to invoke js.

Is there a better solution to figure it out? Why android and iOS designed differently?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions