fix(mobile): keep iOS home header stable #8467
Mergedjuliusmarmingemerged 2 commits into
main fromrefs/pull/8467/headmerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
github-actions[bot](GitHub profile, opens in a new tab) added labels📱 Native Change
- patches/react-native-screens@4.25.2.patch lines 287 to 287OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -237,11 +275,13 @@237275 + NSArray *headerLeftConfigs = config.headerLeftBarButtonItems ?: @[];238276 + NSArray *headerRightConfigs = config.headerRightBarButtonItems ?: @[];239277 + NSArray *headerCenterConfigs = config.headerCenterBarButtonItems ?: @[];240-+ NSArray<UIBarButtonItem *> *subviewLeftItems = navitem.leftBarButtonItems ?: @[];241-+ NSArray<UIBarButtonItem *> *subviewRightItems = navitem.rightBarButtonItems ?: @[];242278 + // The key includes the config instance's identity: cached items capture243279 + // this config's event emitter in their press handlers, so a remounted244280 + // header-config view with value-equal configs must still rebuild — reusing245281 + // the old items would dispatch presses into the dead config's emitter.246-+ NSArray *headerItemsKey =247-+ @[ @((uintptr_t)config), headerLeftConfigs, headerRightConfigs, headerCenterConfigs ];282++ // getUIBarButtonItem is stable for the lifetime of its React header283++ // subview. Include those native identities in the key so React-backed284++ // items can use the same cache without reusing a group after its view was285++ // replaced.286++ NSArray *headerItemsKey = @[287++ @((uintptr_t)config),
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge merged thisb982847
juliusmarminge closed this
Sign in to join this conversation.


Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
02f564f0-109e-44da-9e78-3005cdca6aa8You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Comment `@coderabbitai help` to get the list of available commands.