mirror of
https://github.com/status-im/react-native.git
synced 2025-01-15 12:05:06 +00:00
9f46f425f4
Summary: Managing and transmitting LocalData object to native views. Reviewed By: mdvacca Differential Revision: D7738580 fbshipit-source-id: c889da58d3afe7ac14f411576afe659bd079f641
40 lines
998 B
Plaintext
40 lines
998 B
Plaintext
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#import "RCTUpdateLocalDataMountItem.h"
|
|
|
|
#import "RCTComponentViewRegistry.h"
|
|
|
|
using namespace facebook::react;
|
|
|
|
@implementation RCTUpdateLocalDataMountItem {
|
|
ReactTag _tag;
|
|
SharedLocalData _oldLocalData;
|
|
SharedLocalData _newLocalData;
|
|
}
|
|
|
|
- (instancetype)initWithTag:(ReactTag)tag
|
|
oldLocalData:(facebook::react::SharedLocalData)oldLocalData
|
|
newLocalData:(facebook::react::SharedLocalData)newLocalData
|
|
{
|
|
if (self = [super init]) {
|
|
_tag = tag;
|
|
_oldLocalData = oldLocalData;
|
|
_newLocalData = newLocalData;
|
|
}
|
|
|
|
return self;
|
|
}
|
|
|
|
- (void)executeWithRegistry:(RCTComponentViewRegistry *)registry
|
|
{
|
|
UIView<RCTComponentViewProtocol> *componentView = [registry componentViewByTag:_tag];
|
|
[componentView updateLocalData:_newLocalData oldLocalData:_oldLocalData];
|
|
}
|
|
|
|
@end
|