mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add setNativeValue command to ReactSwitchManager
Summary: Fabric doesn't support setNativeProps, so we have to use commands instead to set the value of the native component. Reviewed By: JoshuaGross Differential Revision: D17736274 fbshipit-source-id: 18c47365926c3c2cfc3551f4b5b6cc72e4162367
This commit is contained in:
committed by
Facebook Github Bot
parent
6166645560
commit
3560093115
+9
@@ -11,6 +11,7 @@ package com.facebook.react.viewmanagers;
|
||||
|
||||
import android.view.View;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.facebook.react.bridge.ReadableArray;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.BaseViewManagerInterface;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
@@ -53,4 +54,12 @@ public class AndroidSwitchManagerDelegate<T extends View, U extends BaseViewMana
|
||||
super.setProperty(view, propName, value);
|
||||
}
|
||||
}
|
||||
|
||||
public void receiveCommand(AndroidSwitchManagerInterface<T> viewManager, T view, String commandName, ReadableArray args) {
|
||||
switch (commandName) {
|
||||
case "setNativeValue":
|
||||
viewManager.setNativeValue(view, args.getBoolean(0));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user