Skip to content

Commit

Permalink
Add support for commands
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sammy-SC authored and facebook-github-bot committed Oct 8, 2019
1 parent 5dbd62c commit 1bf2f72
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ - (RCTLegacyViewManagerInteropCoordinator *)coordinator
}
}

- (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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -54,4 +55,9 @@ - (void)setProps:(folly::dynamic const &)props forView:(UIView *)view
[_componentData setProps:convertedProps forView:view];
}

- (NSString *)componentViewName
{
return RCTDropReactPrefixes(_componentData.name);
}

@end

0 comments on commit 1bf2f72

Please sign in to comment.