mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-06 17:34:07 +08:00
fix setNativeProps crash
Summary: setNativeProps ends up calling UIManager.updateView which fails to find the view tag in the Paper UIManager and crashes. This diff simply checks if the tag is managed by fabric, and calls `fabricUIManager.synchronouslyUpdateViewOnUIThread` if it is. Not the ideal fix, but it generally works (js-driven animations work as well as in Paper) and it's better than crashing or not working at all. Reviewed By: JoshuaGross Differential Revision: D14414523 fbshipit-source-id: 0acd404f55094f8ce8eda39cb87ab58c727fb068
This commit is contained in:
committed by
Facebook Github Bot
parent
45b9b656cc
commit
d9eae2a809
@@ -472,8 +472,13 @@ public class UIManagerModule extends ReactContextBaseJavaModule
|
||||
FLog.d(ReactConstants.TAG, message);
|
||||
PrinterHolder.getPrinter().logMessage(ReactDebugOverlayTags.UI_MANAGER, message);
|
||||
}
|
||||
|
||||
mUIImplementation.updateView(tag, className, props);
|
||||
int uiManagerType = ViewUtil.getUIManagerType(tag);
|
||||
if (uiManagerType == FABRIC) {
|
||||
UIManager fabricUIManager = UIManagerHelper.getUIManager(getReactApplicationContext(), uiManagerType);
|
||||
fabricUIManager.synchronouslyUpdateViewOnUIThread(tag, props);
|
||||
} else {
|
||||
mUIImplementation.updateView(tag, className, props);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user