Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion packages/nitrogen/src/views/CppHybridViewComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ namespace ${namespace} {
void ${descriptorClassName}::adopt(react::ShadowNode& shadowNode) const {
// This is called immediately after \`ShadowNode\` is created, cloned or in progress.
// On Android, we need to wrap props in our state, which gets routed through Java and later unwrapped in JNI/C++.
auto& concreteShadowNode = dynamic_cast<${shadowNodeClassName}&>(shadowNode);
auto& concreteShadowNode = static_cast<${shadowNodeClassName}&>(shadowNode);
const ${propsClassName}& props = concreteShadowNode.getConcreteProps();
${stateClassName} state;
state.setProps(props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ void J${stateUpdaterName}::updateViewProps(jni::alias_ref<jni::JClass> /* class
static_cast<react::StateWrapperImpl::javaobject>(rawStateWrapper)};
std::shared_ptr<const react::State> state = stateWrapper->cthis()->getState();
auto concreteState = std::dynamic_pointer_cast<const ConcreteStateData>(state);
auto concreteState = std::static_pointer_cast<const ConcreteStateData>(state);
const ${stateClassName}& data = concreteState->getData();
const std::optional<${propsClassName}>& maybeProps = data.getProps();
if (!maybeProps.has_value()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void JHybridRecyclableTestViewStateUpdater::updateViewProps(jni::alias_ref<jni::
static_cast<react::StateWrapperImpl::javaobject>(rawStateWrapper)};

std::shared_ptr<const react::State> state = stateWrapper->cthis()->getState();
auto concreteState = std::dynamic_pointer_cast<const ConcreteStateData>(state);
auto concreteState = std::static_pointer_cast<const ConcreteStateData>(state);
const HybridRecyclableTestViewState& data = concreteState->getData();
const std::optional<HybridRecyclableTestViewProps>& maybeProps = data.getProps();
if (!maybeProps.has_value()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void JHybridTestViewStateUpdater::updateViewProps(jni::alias_ref<jni::JClass> /*
static_cast<react::StateWrapperImpl::javaobject>(rawStateWrapper)};

std::shared_ptr<const react::State> state = stateWrapper->cthis()->getState();
auto concreteState = std::dynamic_pointer_cast<const ConcreteStateData>(state);
auto concreteState = std::static_pointer_cast<const ConcreteStateData>(state);
const HybridTestViewState& data = concreteState->getData();
const std::optional<HybridTestViewProps>& maybeProps = data.getProps();
if (!maybeProps.has_value()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ namespace margelo::nitro::test::views {
void HybridRecyclableTestViewComponentDescriptor::adopt(react::ShadowNode& shadowNode) const {
// This is called immediately after `ShadowNode` is created, cloned or in progress.
// On Android, we need to wrap props in our state, which gets routed through Java and later unwrapped in JNI/C++.
auto& concreteShadowNode = dynamic_cast<HybridRecyclableTestViewShadowNode&>(shadowNode);
auto& concreteShadowNode = static_cast<HybridRecyclableTestViewShadowNode&>(shadowNode);
const HybridRecyclableTestViewProps& props = concreteShadowNode.getConcreteProps();
HybridRecyclableTestViewState state;
state.setProps(props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ namespace margelo::nitro::test::views {
void HybridTestViewComponentDescriptor::adopt(react::ShadowNode& shadowNode) const {
// This is called immediately after `ShadowNode` is created, cloned or in progress.
// On Android, we need to wrap props in our state, which gets routed through Java and later unwrapped in JNI/C++.
auto& concreteShadowNode = dynamic_cast<HybridTestViewShadowNode&>(shadowNode);
auto& concreteShadowNode = static_cast<HybridTestViewShadowNode&>(shadowNode);
const HybridTestViewProps& props = concreteShadowNode.getConcreteProps();
HybridTestViewState state;
state.setProps(props);
Expand Down
Loading