mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 21:46:07 +08:00
Fabric: Introducing -[RCTComponentViewProtocol componentHandle]
Summary: The new method in the protocol enforces view component classes to expose a component handle of the component that the view component represents. That will allow us to wire up those classes with shadow views in runtime explicitly and in a much more performant way than it is now. Reviewed By: mdvacca Differential Revision: D13114663 fbshipit-source-id: 853187d978aab200f85719d9c1d9fea2e3ad4e55
This commit is contained in:
committed by
Facebook Github Bot
parent
89f647d521
commit
eef3df86fb
@@ -9,6 +9,7 @@
|
||||
|
||||
#import <react/components/switch/SwitchEventEmitter.h>
|
||||
#import <react/components/switch/SwitchProps.h>
|
||||
#import <react/components/switch/SwitchShadowNode.h>
|
||||
|
||||
using namespace facebook::react;
|
||||
|
||||
@@ -37,6 +38,13 @@ using namespace facebook::react;
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - RCTComponentViewProtocol
|
||||
|
||||
+ (ComponentHandle)componentHandle
|
||||
{
|
||||
return SwitchShadowNode::Handle();
|
||||
}
|
||||
|
||||
- (void)updateProps:(SharedProps)props oldProps:(SharedProps)oldProps
|
||||
{
|
||||
const auto &oldSwitchProps = *std::static_pointer_cast<const SwitchProps>(oldProps ?: _props);
|
||||
|
||||
Reference in New Issue
Block a user