Skip to content

Commit 3849e2c

Browse files
authored
fix: build error with rn 0.73-rc.4 (#1972)
## Description Fixes building against react-native 0.73.0-rc4 in fabric mode on android ## Changes Updated common/cpp/react/renderer/components/rnscreens/RNSScreenComponentDescriptor.h to build with fabric on 0.73-rc4. ## Screenshots / GIFs ### Before ### After ## Test code and steps to reproduce ```sh npx [email protected] init rnscreenstest yarn add react-native-screens cd android # change newArchEnabled to true in `gradle.properties` gradlew build ``` ## Checklist - [ ] Included code example that can be used to test this change - [ ] Updated TS types - [ ] Updated documentation: <!-- For adding new props to native-stack --> - [ ] https://github.com/software-mansion/react-native-screens/blob/main/guides/GUIDE_FOR_LIBRARY_AUTHORS.md - [ ] https://github.com/software-mansion/react-native-screens/blob/main/native-stack/README.md - [ ] https://github.com/software-mansion/react-native-screens/blob/main/src/types.tsx - [ ] https://github.com/software-mansion/react-native-screens/blob/main/src/native-stack/types.tsx - [ ] Ensured that CI passes
1 parent d8e2a9b commit 3849e2c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

common/cpp/react/renderer/components/rnscreens/RNSScreenComponentDescriptor.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,24 @@ class RNSScreenComponentDescriptor final
1212
public:
1313
using ConcreteComponentDescriptor::ConcreteComponentDescriptor;
1414

15-
void adopt(ShadowNode::Unshared const &shadowNode) const override {
15+
void adopt(ShadowNode& shadowNode) const override {
1616
react_native_assert(
17-
std::dynamic_pointer_cast<RNSScreenShadowNode>(shadowNode));
18-
auto screenShadowNode =
19-
std::static_pointer_cast<RNSScreenShadowNode>(shadowNode);
17+
dynamic_cast<RNSScreenShadowNode*>(&shadowNode));
18+
auto& screenShadowNode =
19+
static_cast<RNSScreenShadowNode&>(shadowNode);
2020

2121
react_native_assert(
22-
std::dynamic_pointer_cast<YogaLayoutableShadowNode>(screenShadowNode));
23-
auto layoutableShadowNode =
24-
std::static_pointer_cast<YogaLayoutableShadowNode>(screenShadowNode);
22+
dynamic_cast<YogaLayoutableShadowNode*>(&screenShadowNode));
23+
auto& layoutableShadowNode =
24+
dynamic_cast<YogaLayoutableShadowNode&>(screenShadowNode);
2525

2626
auto state =
2727
std::static_pointer_cast<const RNSScreenShadowNode::ConcreteState>(
28-
shadowNode->getState());
28+
shadowNode.getState());
2929
auto stateData = state->getData();
3030

3131
if (stateData.frameSize.width != 0 && stateData.frameSize.height != 0) {
32-
layoutableShadowNode->setSize(
32+
layoutableShadowNode.setSize(
3333
Size{stateData.frameSize.width, stateData.frameSize.height});
3434
}
3535

0 commit comments

Comments
 (0)