diff --git a/packages/nitrogen/src/views/CppHybridViewComponent.ts b/packages/nitrogen/src/views/CppHybridViewComponent.ts index d2095b64..6de0a0cf 100644 --- a/packages/nitrogen/src/views/CppHybridViewComponent.ts +++ b/packages/nitrogen/src/views/CppHybridViewComponent.ts @@ -118,7 +118,7 @@ namespace ${namespace} { ${stateClassName}() = default; public: - void setProps(${propsClassName}&& props) { _props.emplace(props); } + void setProps(${propsClassName}&& props) { _props.emplace(std::move(props)); } const std::optional<${propsClassName}>& getProps() const { return _props; } public: diff --git a/packages/nitrogen/src/views/kotlin/KotlinHybridViewManager.ts b/packages/nitrogen/src/views/kotlin/KotlinHybridViewManager.ts index 11c62b2b..f524bdcc 100644 --- a/packages/nitrogen/src/views/kotlin/KotlinHybridViewManager.ts +++ b/packages/nitrogen/src/views/kotlin/KotlinHybridViewManager.ts @@ -167,8 +167,7 @@ void J${stateUpdaterName}::updateViewProps(jni::alias_ref, jni::alias_ref stateWrapper) { ${JHybridTSpec}* view = javaView->cthis(); const react::State& state = stateWrapper->cthis()->getState(); - // TODO: Can this be a static_cast? - const auto& concreteState = dynamic_cast(state); + const auto& concreteState = static_cast(state); const ${stateClassName}& data = concreteState.getData(); const std::optional<${propsClassName}>& maybeProps = data.getProps(); if (!maybeProps.has_value()) { diff --git a/packages/react-native-nitro-image/nitrogen/generated/android/c++/views/JHybridTestViewStateUpdater.cpp b/packages/react-native-nitro-image/nitrogen/generated/android/c++/views/JHybridTestViewStateUpdater.cpp index 81e414a2..617d8e5d 100644 --- a/packages/react-native-nitro-image/nitrogen/generated/android/c++/views/JHybridTestViewStateUpdater.cpp +++ b/packages/react-native-nitro-image/nitrogen/generated/android/c++/views/JHybridTestViewStateUpdater.cpp @@ -20,8 +20,7 @@ void JHybridTestViewStateUpdater::updateViewProps(jni::alias_ref, jni::alias_ref stateWrapper) { JHybridTestViewSpec* view = javaView->cthis(); const react::State& state = stateWrapper->cthis()->getState(); - // TODO: Can this be a static_cast? - const auto& concreteState = dynamic_cast(state); + const auto& concreteState = static_cast(state); const HybridTestViewState& data = concreteState.getData(); const std::optional& maybeProps = data.getProps(); if (!maybeProps.has_value()) { diff --git a/packages/react-native-nitro-image/nitrogen/generated/shared/c++/views/HybridTestViewComponent.hpp b/packages/react-native-nitro-image/nitrogen/generated/shared/c++/views/HybridTestViewComponent.hpp index e1cb5094..3675723b 100644 --- a/packages/react-native-nitro-image/nitrogen/generated/shared/c++/views/HybridTestViewComponent.hpp +++ b/packages/react-native-nitro-image/nitrogen/generated/shared/c++/views/HybridTestViewComponent.hpp @@ -56,7 +56,7 @@ namespace margelo::nitro::image::views { HybridTestViewState() = default; public: - void setProps(HybridTestViewProps&& props) { _props.emplace(props); } + void setProps(HybridTestViewProps&& props) { _props.emplace(std::move(props)); } const std::optional& getProps() const { return _props; } public: