@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface ReactModule
BaseJavaModule
s to describe properties for that module.Modifier and Type | Required Element and Description |
---|---|
java.lang.String |
name
Name used to
require() this module from JavaScript. |
Modifier and Type | Optional Element and Description |
---|---|
boolean |
canOverrideExistingModule
True if you intend to override some other native module that was registered e.g.
|
boolean |
needsEagerInit
Whether this module needs to be loaded immediately.
|
boolean |
supportsWebWorkers
In order to support web workers, a module must be aware that it can be invoked from multiple
different JS VMs.
|
public abstract java.lang.String name
require()
this module from JavaScript.public abstract boolean canOverrideExistingModule
public abstract boolean supportsWebWorkers
ExecutorToken
as the first parameter before any arguments
from JS. This ExecutorToken internally maps to a specific JS VM and can be used by the
framework to route calls appropriately. In order to make JS module calls correctly, start using
the version of ReactContext.getJSModule(ExecutorToken, Class)
that takes an
ExecutorToken. It will ensure that any calls you dispatch to the returned object will go to
the right VM. For Callbacks, you don't have to do anything special -- the framework
automatically tags them with the correct ExecutorToken when the are created.
Note: even though calls can come from multiple JS VMs on multiple threads, calls to this module
will still only occur on a single thread.public abstract boolean needsEagerInit