mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
5c4979b2a5
Summary: This change introducing using `updateStateWithAutorepeat` for state updates in RCTSafeAreaViewComponentView. This way we can reduce the number of active commits and reduce jumps & relayout passes. The approach with a callback is better than using `_lastPaddingStateWasUpdatedWith` because: * When we compare the values, we can compare them with actual previous padding numbers stored in Shadow Tree. * The value stored in a UIView instance can go away because of a view being remounted because of flattening. Changelog: [Internal] Fabric-specific internal change. Reviewed By: JoshuaGross Differential Revision: D24719345 fbshipit-source-id: 9bf1ae284875b4c99cf23be2fcc9a829eb8a895e
25 lines
450 B
C++
25 lines
450 B
C++
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <react/renderer/graphics/Geometry.h>
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
/*
|
|
* State for <SafeAreaView> component.
|
|
*/
|
|
class SafeAreaViewState final {
|
|
public:
|
|
EdgeInsets padding{};
|
|
};
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|