-
- All Implemented Interfaces:
-
java.lang.annotation.Annotation
@Retention(value = RUNTIME) public @interface ReactMethod
Annotation which is used to mark methods that are exposed to React Native.
This applies to derived classes of BaseJavaModule, which will generate a list of exported methods by searching for those which are annotated with this annotation and adding a JS callback for each.
-
-
Method Summary
Modifier and Type Method Description abstract boolean
isBlockingSynchronousMethod()
Whether the method can be called from JS synchronously **on the JS thread**, possibly returninga result. -
-
Method Detail
-
isBlockingSynchronousMethod
abstract boolean isBlockingSynchronousMethod()
Whether the method can be called from JS synchronously **on the JS thread**, possibly returninga result.
WARNING: in the vast majority of cases, you should leave this to false which allows yournative module methods to be called asynchronously: calling methods synchronously can havestrong performance penalties and introduce threading-related bugs to your native modules.
In order to support remote debugging, both the method args and return type must beserializable to JSON: this means that we only support the same args as ReactMethod, andthe hook can only be void or return JSON values (e.g. bool, number, String, , or WritableArray). Calling these methods when running under the websocketexecutor is currently not supported.
-
-
-
-