mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-12 03:35:30 +08:00
Fix events not working after closing and navigating back to Fabric screen in FB4A
Reviewed By: fkgozali Differential Revision: D8240344 fbshipit-source-id: 992945f94843589cefdf7ea24da709449ee38778
This commit is contained in:
committed by
Facebook Github Bot
parent
de18dd2648
commit
e95e73aaa7
@@ -66,6 +66,7 @@ public class FabricUIManager implements UIManager, JSHandler {
|
||||
private final FabricReconciler mFabricReconciler;
|
||||
private final EventDispatcher mEventDispatcher;
|
||||
private FabricBinding mBinding;
|
||||
private final FabricEventEmitter mFabricEventEmitter;
|
||||
private long mEventHandlerPointer;
|
||||
|
||||
public FabricUIManager(
|
||||
@@ -81,6 +82,8 @@ public class FabricUIManager implements UIManager, JSHandler {
|
||||
new UIViewOperationQueue(
|
||||
reactContext, mNativeViewHierarchyManager, 0);
|
||||
mFabricReconciler = new FabricReconciler(mUIViewOperationQueue);
|
||||
mFabricEventEmitter =
|
||||
new FabricEventEmitter(mReactApplicationContext, this);
|
||||
mEventDispatcher = eventDispatcher;
|
||||
mJSContext = jsContext;
|
||||
}
|
||||
@@ -537,12 +540,14 @@ public class FabricUIManager implements UIManager, JSHandler {
|
||||
public void initialize() {
|
||||
FabricEventEmitter eventEmitter =
|
||||
new FabricEventEmitter(mReactApplicationContext, this);
|
||||
mEventDispatcher.registerEventEmitter(FABRIC, eventEmitter);
|
||||
mEventDispatcher.registerEventEmitter(FABRIC, mFabricEventEmitter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCatalystInstanceDestroy() {
|
||||
mBinding.releaseEventHandler(mJSContext.get(), mEventHandlerPointer);
|
||||
mEventDispatcher.unregisterEventEmitter(FABRIC);
|
||||
mFabricEventEmitter.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user