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?