Inherits from NSObject
Conforms to RCTInvalidating
Declared in RCTBridge.h

Overview

Async batched bridge used to communicate with the JavaScript application.

This category makes the developer menu instance available via the RCTBridge, which is useful for any class that needs to access the menu.

This category makes the current RCTUIManager instance available via the RCTBridge, which is useful for RCTBridgeModules or RCTViewManagers that need to access the RCTUIManager.

Tasks

Other Methods

  • – initWithBundleURL:moduleProvider:launchOptions:

    The designated initializer. This creates a new bridge on top of the specified executor. The bridge should then be used for all subsequent communication with the JavaScript code running in the executor. Modules will be automatically instantiated using the default contructor, but you can optionally pass in an array of pre-initialized module instances if they require additional init parameters or configuration.

  • – enqueueJSCall:args:

    This method is used to call functions in the JavaScript application context. It is primarily intended for use by modules that require two-way communication with the JavaScript code. Safe to call from any thread.

  •   bundleURL

    URL of the script that was loaded into the bridge.

    property
  •   executorClass property
  •   eventDispatcher

    The event dispatcher is a wrapper around enqueueJSCall:args: that provides a higher-level interface for sending UI events such as touches and text input.

    property
  •   modules

    A dictionary of all registered RCTBridgeModule instances, keyed by moduleName.

    property
  •   launchOptions

    The launch options that were used to initialize the bridge.

    property
  •   loading

    Use this to check if the bridge is currently loading.

    property
  •   moduleProvider

    The block passed in the constructor with pre-initialized modules

    property
  • – reload

    Reload the bundle and reset executor & modules. Safe to call from any thread.

RCTDevMenu Methods

RCTUIManager Methods

RCTPerfStats Methods

Properties

bundleURL

@property (nonatomic, copy) NSURL *bundleURL
Discussion

URL of the script that was loaded into the bridge.

Declared In

RCTBridge.h

devMenu

@property (nonatomic, readonly) RCTDevMenu *devMenu

eventDispatcher

@property (nonatomic, readonly) RCTEventDispatcher *eventDispatcher
Discussion

The event dispatcher is a wrapper around enqueueJSCall:args: that provides a higher-level interface for sending UI events such as touches and text input.

NOTE: RCTEventDispatcher is now a bridge module, this is implemented as a category but remains declared in the bridge to avoid breaking changes

To be moved.

Declared In

RCTBridge.h

executorClass

@property (nonatomic, strong) Class executorClass

launchOptions

@property (nonatomic, copy, readonly) NSDictionary *launchOptions
Discussion

The launch options that were used to initialize the bridge.

Declared In

RCTBridge.h

loading

@property (nonatomic, readonly, getter=isLoading) BOOL loading
Discussion

Use this to check if the bridge is currently loading.

Declared In

RCTBridge.h

moduleProvider

@property (nonatomic, copy, readonly) RCTBridgeModuleProviderBlock moduleProvider
Discussion

The block passed in the constructor with pre-initialized modules

Declared In

RCTBridge.h

modules

@property (nonatomic, copy, readonly) NSDictionary *modules
Discussion

A dictionary of all registered RCTBridgeModule instances, keyed by moduleName.

Declared In

RCTBridge.h

perfStats

@property (nonatomic, strong, readonly) RCTPerfStats *perfStats

uiManager

@property (nonatomic, readonly) RCTUIManager *uiManager

Instance Methods

enqueueJSCall:args:

- (void)enqueueJSCall:(NSString *)moduleDotMethod args:(NSArray *)args
Discussion

This method is used to call functions in the JavaScript application context. It is primarily intended for use by modules that require two-way communication with the JavaScript code. Safe to call from any thread.

Declared In

RCTBridge.h

initWithBundleURL:moduleProvider:launchOptions:

- (instancetype)initWithBundleURL:(NSURL *)bundleURL moduleProvider:(RCTBridgeModuleProviderBlock)block launchOptions:(NSDictionary *)launchOptions
Discussion

The designated initializer. This creates a new bridge on top of the specified executor. The bridge should then be used for all subsequent communication with the JavaScript code running in the executor. Modules will be automatically instantiated using the default contructor, but you can optionally pass in an array of pre-initialized module instances if they require additional init parameters or configuration.

Declared In

RCTBridge.h

reload

- (void)reload
Discussion

Reload the bundle and reset executor & modules. Safe to call from any thread.

Declared In

RCTBridge.h