Skip to content

Commit bc972e6

Browse files
author
Julius Marminge
committed
fix(mobile): keep header config cache keys alive
1 parent 79e063e commit bc972e6

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

‎patches/[email protected]‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -275,16 +275,16 @@ index 5970e3e3a624b9498b8dedfc16831df03a274d0c..5ebff085788d813f1139eb6f9129fb21
275275
+ NSArray *headerLeftConfigs = config.headerLeftBarButtonItems ?: @[];
276276
+ NSArray *headerRightConfigs = config.headerRightBarButtonItems ?: @[];
277277
+ NSArray *headerCenterConfigs = config.headerCenterBarButtonItems ?: @[];
278-
+ // The key includes the config instance's identity: cached items capture
279-
+ // this config's event emitter in their press handlers, so a remounted
280-
+ // header-config view with value-equal configs must still rebuild — reusing
281-
+ // the old items would dispatch presses into the dead config's emitter.
278+
+ // Retain the config in the key so its address cannot be reused while cached.
279+
+ // Items capture this config's event emitter in their press handlers, so a
280+
+ // remounted header-config view with value-equal configs must still rebuild
281+
+ // instead of dispatching presses into the old config's emitter.
282282
+ // getUIBarButtonItem is stable for the lifetime of its React header
283283
+ // subview. Include those native identities in the key so React-backed
284284
+ // items can use the same cache without reusing a group after its view was
285285
+ // replaced.
286286
+ NSArray *headerItemsKey = @[
287-
+ @((uintptr_t)config),
287+
+ config,
288288
+ headerLeftConfigs,
289289
+ headerRightConfigs,
290290
+ headerCenterConfigs,

‎pnpm-lock.yaml‎

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)