-
-
Notifications
You must be signed in to change notification settings - Fork 457
Expand file tree
/
Copy pathComponentDescriptors.h
More file actions
36 lines (26 loc) · 1.15 KB
/
ComponentDescriptors.h
File metadata and controls
36 lines (26 loc) · 1.15 KB
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
35
36
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
* and copied to the cpp directory to override the adopt function and set the size of the shadow node based
* on the state.
* @generated by codegen project: GenerateComponentDescriptorH.js
*/
#pragma once
#include "ShadowNodes.h"
#include <react/renderer/core/ConcreteComponentDescriptor.h>
namespace facebook {
namespace react {
class RNDateTimePickerComponentDescriptor final : public ConcreteComponentDescriptor<RNDateTimePickerShadowNode> {
public:
using ConcreteComponentDescriptor::ConcreteComponentDescriptor;
void adopt(ShadowNode& shadowNode) const override {
auto& pickerShadowNode = static_cast<RNDateTimePickerShadowNode&>(shadowNode);
auto state = std::static_pointer_cast<const RNDateTimePickerShadowNode::ConcreteState>(shadowNode.getState());
auto stateData = state->getData();
if(stateData.frameSize.height != 0) {
pickerShadowNode.setMeasuredHeight(stateData.frameSize.height);
}
ConcreteComponentDescriptor::adopt(shadowNode);
}
};
} // namespace react
} // namespace facebook