diff --git a/ReactCommon/fabric/components/safeareaview/SafeAreaViewComponentDescriptor.h b/ReactCommon/fabric/components/safeareaview/SafeAreaViewComponentDescriptor.h index aac036f2d01..23b1e37c289 100644 --- a/ReactCommon/fabric/components/safeareaview/SafeAreaViewComponentDescriptor.h +++ b/ReactCommon/fabric/components/safeareaview/SafeAreaViewComponentDescriptor.h @@ -35,7 +35,10 @@ class SafeAreaViewComponentDescriptor final shadowNode->getState()); auto stateData = state->getData(); - layoutableShadowNode->setPadding(stateData.padding); + if (safeAreaViewShadowNode->alreadyAppliedPadding != stateData.padding) { + safeAreaViewShadowNode->alreadyAppliedPadding = stateData.padding; + layoutableShadowNode->setPadding(stateData.padding); + } ConcreteComponentDescriptor::adopt(shadowNode); } diff --git a/ReactCommon/fabric/components/safeareaview/SafeAreaViewShadowNode.h b/ReactCommon/fabric/components/safeareaview/SafeAreaViewShadowNode.h index 44970270ef0..27df74ffaba 100644 --- a/ReactCommon/fabric/components/safeareaview/SafeAreaViewShadowNode.h +++ b/ReactCommon/fabric/components/safeareaview/SafeAreaViewShadowNode.h @@ -26,6 +26,9 @@ class SafeAreaViewShadowNode final : public ConcreteViewShadowNode< ViewEventEmitter, SafeAreaViewState> { using ConcreteViewShadowNode::ConcreteViewShadowNode; + + public: + EdgeInsets alreadyAppliedPadding{}; }; } // namespace react