diff --git a/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm b/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm index a7c1aae36f2..c6edab447e3 100644 --- a/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm @@ -10,9 +10,13 @@ #import #import #import +#import using namespace facebook::react; +@interface RCTSwitchComponentView () +@end + @implementation RCTSwitchComponentView { UISwitch *_switchView; } @@ -96,4 +100,16 @@ using namespace facebook::react; ->onChange(SwitchOnChangeStruct{.value = static_cast(sender.on)}); } +#pragma mark - Native Commands + +- (void)handleCommand:(const NSString *)commandName args:(const NSArray *)args +{ + RCTSwitchHandleCommand(self, commandName, args); +} + +- (void)setValue:(BOOL)value +{ + [_switchView setOn:value animated:YES]; +} + @end