File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed
packages/react-native/ReactAndroid
src/main/java/com/facebook/react Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -318,6 +318,7 @@ public abstract class com/facebook/react/ReactNativeHost {
318318 protected fun getDevSupportManagerFactory ()Lcom/facebook/react/devsupport/DevSupportManagerFactory;
319319 protected fun getJSBundleFile ()Ljava/lang/String;
320320 protected fun getJSEngineResolutionAlgorithm ()Lcom/facebook/react/JSEngineResolutionAlgorithm;
321+ protected fun getJSExceptionHandler ()Lcom/facebook/react/bridge/JSExceptionHandler;
321322 protected fun getJSMainModuleName ()Ljava/lang/String;
322323 protected fun getJavaScriptExecutorFactory ()Lcom/facebook/react/bridge/JavaScriptExecutorFactory;
323324 public fun getLazyViewManagersEnabled ()Z
Original file line number Diff line number Diff line change @@ -258,7 +258,7 @@ public ReactInstanceManagerBuilder setInitialLifecycleState(
258258 * DevSupportManager} will be used, which shows a redbox in dev mode and rethrows (crashes the
259259 * app) in prod mode.
260260 */
261- public ReactInstanceManagerBuilder setJSExceptionHandler (JSExceptionHandler handler ) {
261+ public ReactInstanceManagerBuilder setJSExceptionHandler (@ Nullable JSExceptionHandler handler ) {
262262 mJSExceptionHandler = handler ;
263263 return this ;
264264 }
Original file line number Diff line number Diff line change 1010import android .app .Application ;
1111import androidx .annotation .Nullable ;
1212import com .facebook .infer .annotation .Assertions ;
13+ import com .facebook .react .bridge .JSExceptionHandler ;
1314import com .facebook .react .bridge .JavaScriptExecutorFactory ;
1415import com .facebook .react .bridge .ReactMarker ;
1516import com .facebook .react .bridge .ReactMarkerConstants ;
@@ -89,6 +90,7 @@ protected ReactInstanceManagerBuilder getBaseReactInstanceManagerBuilder() {
8990 .setDevLoadingViewManager (getDevLoadingViewManager ())
9091 .setRequireActivity (getShouldRequireActivity ())
9192 .setSurfaceDelegateFactory (getSurfaceDelegateFactory ())
93+ .setJSExceptionHandler (getJSExceptionHandler ())
9294 .setLazyViewManagersEnabled (getLazyViewManagersEnabled ())
9395 .setRedBoxHandler (getRedBoxHandler ())
9496 .setJavaScriptExecutorFactory (getJavaScriptExecutorFactory ())
@@ -118,6 +120,10 @@ protected ReactInstanceManagerBuilder getBaseReactInstanceManagerBuilder() {
118120 return null ;
119121 }
120122
123+ protected @ Nullable JSExceptionHandler getJSExceptionHandler () {
124+ return null ;
125+ }
126+
121127 /** Get the {@link JavaScriptExecutorFactory}. Override this to use a custom Executor. */
122128 protected @ Nullable JavaScriptExecutorFactory getJavaScriptExecutorFactory () {
123129 return null ;
You can’t perform that action at this time.
0 commit comments