Skip to content

Commit 56478a1

Browse files
committed
perf: Use static_cast for shadow node
1 parent 3116736 commit 56478a1

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/nitrogen/src/views/CppHybridViewComponent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ namespace ${namespace} {
272272
void ${descriptorClassName}::adopt(react::ShadowNode& shadowNode) const {
273273
// This is called immediately after \`ShadowNode\` is created, cloned or in progress.
274274
// On Android, we need to wrap props in our state, which gets routed through Java and later unwrapped in JNI/C++.
275-
auto& concreteShadowNode = dynamic_cast<${shadowNodeClassName}&>(shadowNode);
275+
auto& concreteShadowNode = static_cast<${shadowNodeClassName}&>(shadowNode);
276276
const ${propsClassName}& props = concreteShadowNode.getConcreteProps();
277277
${stateClassName} state;
278278
state.setProps(props);

packages/react-native-nitro-test/nitrogen/generated/shared/c++/views/HybridRecyclableTestViewComponent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ namespace margelo::nitro::test::views {
7777
void HybridRecyclableTestViewComponentDescriptor::adopt(react::ShadowNode& shadowNode) const {
7878
// This is called immediately after `ShadowNode` is created, cloned or in progress.
7979
// On Android, we need to wrap props in our state, which gets routed through Java and later unwrapped in JNI/C++.
80-
auto& concreteShadowNode = dynamic_cast<HybridRecyclableTestViewShadowNode&>(shadowNode);
80+
auto& concreteShadowNode = static_cast<HybridRecyclableTestViewShadowNode&>(shadowNode);
8181
const HybridRecyclableTestViewProps& props = concreteShadowNode.getConcreteProps();
8282
HybridRecyclableTestViewState state;
8383
state.setProps(props);

packages/react-native-nitro-test/nitrogen/generated/shared/c++/views/HybridTestViewComponent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ namespace margelo::nitro::test::views {
113113
void HybridTestViewComponentDescriptor::adopt(react::ShadowNode& shadowNode) const {
114114
// This is called immediately after `ShadowNode` is created, cloned or in progress.
115115
// On Android, we need to wrap props in our state, which gets routed through Java and later unwrapped in JNI/C++.
116-
auto& concreteShadowNode = dynamic_cast<HybridTestViewShadowNode&>(shadowNode);
116+
auto& concreteShadowNode = static_cast<HybridTestViewShadowNode&>(shadowNode);
117117
const HybridTestViewProps& props = concreteShadowNode.getConcreteProps();
118118
HybridTestViewState state;
119119
state.setProps(props);

0 commit comments

Comments
 (0)