From c0a86e779d588829a13753b6aaf300394435b822 Mon Sep 17 00:00:00 2001 From: Ruslan Shestopalyuk Date: Mon, 26 Feb 2024 17:03:11 -0800 Subject: [PATCH] Correctly initialize default transformOrigin prop value to "center" Summary: ## Changelog: [Internal] - `view.transformOrigin` prop should be initialized to "center", since this is default [per documentaion](https://reactnative.dev/docs/next/transforms#transform-origin), and it should be treated this way even if the prop is not explicitly set from JS. Differential Revision: D54229772 --- .../react/renderer/components/view/BaseViewProps.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/BaseViewProps.h b/packages/react-native/ReactCommon/react/renderer/components/view/BaseViewProps.h index b7bdd9afc7eb55..081c1d760ed216 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/BaseViewProps.h +++ b/packages/react-native/ReactCommon/react/renderer/components/view/BaseViewProps.h @@ -54,7 +54,12 @@ class BaseViewProps : public YogaStylableProps, public AccessibilityProps { // Transform Transform transform{}; - TransformOrigin transformOrigin{}; + TransformOrigin transformOrigin{{ + ValueUnit{50.0f, UnitType::Percent}, + ValueUnit{50.0f, UnitType::Percent}, + }, + 0.0f, + }; BackfaceVisibility backfaceVisibility{}; bool shouldRasterize{}; std::optional zIndex{};