IReactContext object is a weak pointer to the React instance. It allows native modules and view managers to communicate with the application, and with other native modules and view managers.
IReactContext is a weak pointer to the React instance, some of its functionality becomes unavailable after the React instance is unloaded. When a React instance is reloaded inside of the
ReactNativeHost, the previous React instance is unloaded and then a new React instance is created with a new
- Use the
Propertiesto share native module's data with other components.
- Use the
Notificationsto exchange events with other components.
UIDispatcherto post asynchronous work in the UI thread.
IReactNotificationService shared with the
It can be used to send notifications events between components and the application.
All notification subscriptions added to the
IReactContext.Notifications are automatically removed after the
IReactContext is destroyed.
The notification subscriptions added to the
ReactInstanceSettings.Notifications are kept as long as the
ReactInstanceSettings is alive.
Gets the settings snapshot that was used to start the React instance.
CallJSFunction(string moduleName, string methodName,
moduleName with the
paramsArgWriter is a
JSValueArgWriter delegate that receives
IJSValueWriter to serialize the method parameters.
Deprecated property. Use
XamlUIService.DispatchEvent instead. It will be removed in a future version.
EmitJSEvent(string eventEmitterName, string eventName,
eventName for the
eventEmitterName with the
It is a specialized
call where the method name is alwaysemit
is added to parameters. TheparamsArgWriter
is a [JSValueArgWriter
](JSValueArgWriter) delegate that receives [IJSValueWriter`](IJSValueWriter) to serialize the event parameters.