Add support for commands

Summary: We need commands to work with `LegacyViewManagerInterop`. We will need to rethink this once Fabric has command-execution pipeline in place.

Reviewed By: shergin

Differential Revision: D17787294

fbshipit-source-id: a6b3dbfae41f04e7e7f5bafb1f7b4ad0de0eedc3
This commit is contained in:
Samuel Susla
2019-10-08 09:05:16 -07:00
committed by Facebook Github Bot
parent 5dbd62c7ff
commit 1bf2f72abe
3 changed files with 15 additions and 0 deletions
@@ -46,6 +46,13 @@ using namespace facebook::react;
}
}
- (NSString *)componentViewName_DO_NOT_USE_THIS_IS_BROKEN
{
const auto &state = _state->getData();
RCTLegacyViewManagerInteropCoordinator *coordinator = unwrapManagedObject(state.coordinator);
return coordinator.componentViewName;
}
#pragma mark - RCTComponentViewProtocol
+ (ComponentDescriptorProvider)componentDescriptorProvider
@@ -23,6 +23,8 @@ typedef void (^InterceptorBlock)(std::string eventName, folly::dynamic event);
- (void)setProps:(folly::dynamic const &)props forView:(UIView *)view;
- (NSString *)componentViewName;
@end
NS_ASSUME_NONNULL_END
@@ -8,6 +8,7 @@
#include "RCTLegacyViewManagerInteropCoordinator.h"
#include <React/RCTComponentData.h>
#include <React/RCTFollyConvert.h>
#include <React/RCTUtils.h>
#include <folly/json.h>
using namespace facebook::react;
@@ -54,4 +55,9 @@ using namespace facebook::react;
[_componentData setProps:convertedProps forView:view];
}
- (NSString *)componentViewName
{
return RCTDropReactPrefixes(_componentData.name);
}
@end