mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Simplify API of getReactApplicationContextIfActiveOrWarn
Summary: Simplify the API of `getReactApplicationContextIfActiveOrWarn`. We don't need to pass so much information into this method to collect good SoftExceptions. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D18134400 fbshipit-source-id: 0a250ab0252a44121f3339a31506a0a6c4c7cd35
This commit is contained in:
committed by
Facebook Github Bot
parent
a1a56fe4e5
commit
9446277fc1
@@ -116,8 +116,7 @@ public class NativeAnimatedModule extends ReactContextBaseJavaModule
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
ReactApplicationContext reactApplicationContext =
|
||||
getReactApplicationContextIfActiveOrWarn(NAME, "initialize");
|
||||
ReactApplicationContext reactApplicationContext = getReactApplicationContextIfActiveOrWarn();
|
||||
|
||||
if (reactApplicationContext != null) {
|
||||
UIManagerModule uiManager = reactApplicationContext.getNativeModule(UIManagerModule.class);
|
||||
@@ -179,8 +178,7 @@ public class NativeAnimatedModule extends ReactContextBaseJavaModule
|
||||
|
||||
private NativeAnimatedNodesManager getNodesManager() {
|
||||
if (mNodesManager == null) {
|
||||
ReactApplicationContext reactApplicationContext =
|
||||
getReactApplicationContextIfActiveOrWarn(NAME, "getNodesManager");
|
||||
ReactApplicationContext reactApplicationContext = getReactApplicationContextIfActiveOrWarn();
|
||||
|
||||
if (reactApplicationContext != null) {
|
||||
UIManagerModule uiManager = reactApplicationContext.getNativeModule(UIManagerModule.class);
|
||||
@@ -229,8 +227,7 @@ public class NativeAnimatedModule extends ReactContextBaseJavaModule
|
||||
onAnimatedValueData.putDouble("value", value);
|
||||
|
||||
ReactApplicationContext reactApplicationContext =
|
||||
getReactApplicationContextIfActiveOrWarn(
|
||||
NAME, "startListeningToAnimatedNodeValue.onValueUpdate");
|
||||
getReactApplicationContextIfActiveOrWarn();
|
||||
if (reactApplicationContext != null) {
|
||||
reactApplicationContext
|
||||
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
|
||||
|
||||
Reference in New Issue
Block a user