Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: new arch support for 0.74 #888

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,15 @@ class RNDateTimePickerComponentDescriptor final : public ConcreteComponentDescri
public:
using ConcreteComponentDescriptor::ConcreteComponentDescriptor;

void adopt(ShadowNode::Unshared const &shadowNode) const override {
react_native_assert(std::dynamic_pointer_cast<RNDateTimePickerShadowNode>(shadowNode));
auto pickerShadowNode = std::static_pointer_cast<RNDateTimePickerShadowNode>(shadowNode);
void adopt(ShadowNode& shadowNode) const override {
auto& pickerShadowNode = static_cast<RNDateTimePickerShadowNode&>(shadowNode);
auto& layoutableShadowNode = static_cast<YogaLayoutableShadowNode&>(pickerShadowNode);

react_native_assert(
std::dynamic_pointer_cast<YogaLayoutableShadowNode>(pickerShadowNode));
auto layoutableShadowNode =
std::static_pointer_cast<YogaLayoutableShadowNode>(pickerShadowNode);

auto state = std::static_pointer_cast<const RNDateTimePickerShadowNode::ConcreteState>(shadowNode->getState());
auto state = std::static_pointer_cast<const RNDateTimePickerShadowNode::ConcreteState>(shadowNode.getState());
auto stateData = state->getData();

if(stateData.frameSize.width != 0 && stateData.frameSize.height != 0) {
layoutableShadowNode->setSize(Size{stateData.frameSize.width, stateData.frameSize.height});
layoutableShadowNode.setSize(Size{stateData.frameSize.width, stateData.frameSize.height});
}

ConcreteComponentDescriptor::adopt(shadowNode);
Expand Down