Skip to content

Commit 4a21ced

Browse files
authored
Merge pull request #2275 from didi/fix-rn-split-chunk-onShow
Fix: onShow callback is not triggered during the initial render of subpackage page
2 parents c97d6d2 + 7ff97fa commit 4a21ced

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

packages/core/src/platform/patch/getDefaultOptions.ios.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,11 @@ function usePageStatus (navigation, pageId) {
420420
set(pageStatusMap, pageId, '')
421421
}
422422
useEffect(() => {
423+
if (navigation.isFocused && navigation.isFocused()) {
424+
Promise.resolve().then(() => {
425+
pageStatusMap[pageId] = 'show'
426+
})
427+
}
423428
const focusSubscription = navigation.addListener('focus', () => {
424429
pageStatusMap[pageId] = 'show'
425430
})

0 commit comments

Comments
 (0)