Skip to content

Commit 3b93f0e

Browse files
rshestfacebook-github-bot
authored andcommitted
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. Reviewed By: christophpurrer Differential Revision: D54229772 fbshipit-source-id: 5212792c8dc5db6f4c17d1b2980ac2564c986cd8
1 parent 2c1bcba commit 3b93f0e

File tree

1 file changed

+8
-1
lines changed
  • packages/react-native/ReactCommon/react/renderer/components/view

1 file changed

+8
-1
lines changed

packages/react-native/ReactCommon/react/renderer/components/view/BaseViewProps.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,14 @@ class BaseViewProps : public YogaStylableProps, public AccessibilityProps {
5454

5555
// Transform
5656
Transform transform{};
57-
TransformOrigin transformOrigin{};
57+
TransformOrigin transformOrigin{
58+
{
59+
ValueUnit{50.0f, UnitType::Percent},
60+
ValueUnit{50.0f, UnitType::Percent},
61+
},
62+
0.0f,
63+
64+
};
5865
BackfaceVisibility backfaceVisibility{};
5966
bool shouldRasterize{};
6067
std::optional<int> zIndex{};

0 commit comments

Comments
 (0)