Annotation for a method in a
NativeModule
that can be called from JS synchronously **on
the JS thread**, possibly returning a result.
In order to support remote debugging, both the method args and return type must be serializable
to JSON: this means that we only support the same args as
ReactMethod
, and the hook can
only be void or return JSON values (e.g. bool, number, String,
WritableMap
, or
WritableArray
).
In the vast majority of cases, you should use
ReactMethod
which allows your native module
methods to be called asynchronously: calling methods synchronously can have strong performance
penalties and introduce threading-related bugs to your native modules.