mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-31 10:56:42 +08:00
Summary: This pull request implements some suggestions made in #23414, namely: * Rename `ShadowNodeFragment::nullSharedProps()` (and family) to `ShadowNodeFragment::propsPlaceholder()`; * Introduce similar functions for the rest of members (tag and rootTag); Later pull requests to remove designated initializers from Fabric (for MSVC support) will use these I'd like to do the rename of `rootTag` to `surfaceId` as well, but would make sense to do in a separate diff as that would result in a great deal of changes. [General] [Changed] - Changed naming scheme of `ShadowNodeFragment` placeholders, and added placeholders for remaining members Pull Request resolved: https://github.com/facebook/react-native/pull/23437 Reviewed By: mdvacca Differential Revision: D14072007 Pulled By: shergin fbshipit-source-id: d5bb10a82c16d45955f417a49b503f215c4bc521
43 lines
984 B
C++
43 lines
984 B
C++
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#include "ShadowNodeFragment.h"
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
Tag ShadowNodeFragment::tagPlaceholder() {
|
|
return 0;
|
|
}
|
|
|
|
Tag ShadowNodeFragment::surfaceIdPlaceholder() {
|
|
return 0;
|
|
}
|
|
|
|
SharedProps &ShadowNodeFragment::propsPlaceholder() {
|
|
static auto &instance = *new SharedProps();
|
|
return instance;
|
|
}
|
|
|
|
SharedEventEmitter &ShadowNodeFragment::eventEmitterPlaceholder() {
|
|
static auto &instance = *new SharedEventEmitter();
|
|
return instance;
|
|
}
|
|
|
|
SharedShadowNodeSharedList &ShadowNodeFragment::childrenPlaceholder() {
|
|
static auto &instance = *new SharedShadowNodeSharedList();
|
|
return instance;
|
|
}
|
|
|
|
SharedLocalData &ShadowNodeFragment::localDataPlaceholder() {
|
|
static auto &instance = *new SharedLocalData();
|
|
return instance;
|
|
}
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|