Skip to content

Commit

Permalink
caching header config size, iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
coado committed Nov 28, 2024
1 parent 8541afc commit 396abd4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ios/RNSScreenStackHeaderConfig.mm
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ @implementation RNSScreenStackHeaderConfig {
NSDirectionalEdgeInsets _lastHeaderInsets;
#ifdef RCT_NEW_ARCH_ENABLED
BOOL _initialPropsSet;
CGSize _lastSize;
react::RNSScreenStackHeaderConfigShadowNode::ConcreteState::Shared _state;
#ifndef NDEBUG
RCTImageLoader *imageLoader;
Expand Down Expand Up @@ -204,8 +205,11 @@ - (void)layoutNavigationControllerView
#ifdef RCT_NEW_ARCH_ENABLED
- (void)updateHeaderConfigState:(CGSize)size
{
auto newState = react::RNSScreenStackHeaderConfigState(RCTSizeFromCGSize(size));
_state->updateState(std::move(newState));
if (_lastSize.width != size.width || _lastSize.height != size.height) {
auto newState = react::RNSScreenStackHeaderConfigState(RCTSizeFromCGSize(size));
_state->updateState(std::move(newState));
_lastSize = size;
}
}
#else
- (void)updateHeaderConfigState:(NSDirectionalEdgeInsets)insets
Expand Down

0 comments on commit 396abd4

Please sign in to comment.