-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathShadowTreeCloner.h
More file actions
34 lines (23 loc) · 810 Bytes
/
ShadowTreeCloner.h
File metadata and controls
34 lines (23 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once
#ifdef RCT_NEW_ARCH_ENABLED
#include <react/renderer/core/PropsParserContext.h>
#include <react/renderer/uimanager/UIManager.h>
#include <type_traits>
#include <memory>
#include <unordered_map>
#include <vector>
#include "PropsWrapper.h"
using namespace facebook;
using namespace react;
namespace reanimated {
template<class T>
concept Derived = std::is_base_of_v<PropsWrapper, T>;
template<Derived T>
using PropsMap = std::unordered_map<const ShadowNodeFamily *, std::vector<std::unique_ptr<T>>>;
using ChildrenMap = std::unordered_map<const ShadowNodeFamily *, std::vector<int>>;
template<Derived T>
ShadowNode::Unshared cloneShadowTreeWithNewProps(
const ShadowNode::Shared &oldRootNode,
const PropsMap<T> &propsMap);
} // namespace reanimated
#endif // RCT_NEW_ARCH_ENABLED