@@ -1093,13 +1093,11 @@ LayoutAnimationKeyFrameManager::pullTransaction(
1093
1093
getComponentDescriptorForShadowView (baselineShadowView)
1094
1094
.cloneProps (propsParserContext, viewStart.props , {});
1095
1095
1096
- // Dynamic cast, because - we don't know the type of this
1097
- // ShadowNode, it could be Image or Text or something else with
1098
- // different base props.
1099
- const auto viewProps =
1100
- dynamic_cast <const ViewProps *>(props.get ());
1101
- if (viewProps != nullptr ) {
1102
- const_cast <ViewProps *>(viewProps)->opacity = 0 ;
1096
+ if (baselineShadowView.traits .check (
1097
+ ShadowNodeTraits::Trait::ViewKind)) {
1098
+ auto const &viewProps =
1099
+ *std::static_pointer_cast<ViewProps const >(props);
1100
+ const_cast <ViewProps &>(viewProps).opacity = 0 ;
1103
1101
}
1104
1102
1105
1103
react_native_assert (props != nullptr );
@@ -1118,13 +1116,11 @@ LayoutAnimationKeyFrameManager::pullTransaction(
1118
1116
getComponentDescriptorForShadowView (baselineShadowView)
1119
1117
.cloneProps (propsParserContext, viewStart.props , {});
1120
1118
1121
- // Dynamic cast, because - we don't know the type of this
1122
- // ShadowNode, it could be Image or Text or something else with
1123
- // different base props.
1124
- const auto viewProps =
1125
- dynamic_cast <const ViewProps *>(props.get ());
1126
- if (viewProps != nullptr ) {
1127
- const_cast <ViewProps *>(viewProps)->transform =
1119
+ if (baselineShadowView.traits .check (
1120
+ ShadowNodeTraits::Trait::ViewKind)) {
1121
+ auto const &viewProps =
1122
+ *std::static_pointer_cast<ViewProps const >(props);
1123
+ const_cast <ViewProps &>(viewProps).transform =
1128
1124
Transform::Scale (isScaleX ? 0 : 1 , isScaleY ? 0 : 1 , 1 );
1129
1125
}
1130
1126
@@ -1221,13 +1217,11 @@ LayoutAnimationKeyFrameManager::pullTransaction(
1221
1217
getComponentDescriptorForShadowView (baselineShadowView)
1222
1218
.cloneProps (propsParserContext, viewFinal.props , {});
1223
1219
1224
- // Dynamic cast, because - we don't know the type of this
1225
- // ShadowNode, it could be Image or Text or something else with
1226
- // different base props.
1227
- const auto viewProps =
1228
- dynamic_cast <const ViewProps *>(props.get ());
1229
- if (viewProps != nullptr ) {
1230
- const_cast <ViewProps *>(viewProps)->opacity = 0 ;
1220
+ if (baselineShadowView.traits .check (
1221
+ ShadowNodeTraits::Trait::ViewKind)) {
1222
+ auto const &viewProps =
1223
+ *std::static_pointer_cast<ViewProps const >(props);
1224
+ const_cast <ViewProps &>(viewProps).opacity = 0 ;
1231
1225
}
1232
1226
1233
1227
react_native_assert (props != nullptr );
@@ -1248,13 +1242,11 @@ LayoutAnimationKeyFrameManager::pullTransaction(
1248
1242
getComponentDescriptorForShadowView (baselineShadowView)
1249
1243
.cloneProps (propsParserContext, viewFinal.props , {});
1250
1244
1251
- // Dynamic cast, because - we don't know the type of this
1252
- // ShadowNode, it could be Image or Text or something else with
1253
- // different base props.
1254
- const auto viewProps =
1255
- dynamic_cast <const ViewProps *>(props.get ());
1256
- if (viewProps != nullptr ) {
1257
- const_cast <ViewProps *>(viewProps)->transform =
1245
+ if (baselineShadowView.traits .check (
1246
+ ShadowNodeTraits::Trait::ViewKind)) {
1247
+ auto const &viewProps =
1248
+ *std::static_pointer_cast<ViewProps const >(props);
1249
+ const_cast <ViewProps &>(viewProps).transform =
1258
1250
Transform::Scale (isScaleX ? 0 : 1 , isScaleY ? 0 : 1 , 1 );
1259
1251
}
1260
1252
0 commit comments