Skip to content

Commit 544ea4e

Browse files
committed
Clarify documentation on overriding Android's onCreate method in MainActivity to prevent white screen issues after hot reloads. Ensure instructions are clear and concise, emphasizing the correct placement of the RNScreensFragmentFactory setup.
1 parent 190fe2e commit 544ea4e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

site/pages/docs/getting-started.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ struct Index {
480480
481481
### 覆盖 android 的 onCreate
482482
483-
如果你有安装 `react-native-screens` (使用 `react-navigation` 一般都会要求安装),则安卓端在热更后重启可能会白屏。此时需要在 Android 的 `MainActivity` 中设置 `RNScreensFragmentFactory`,以确保 Fragment 恢复流程一致,避免崩溃。注意不要把这段覆盖写在 `MainActivityDelegate` 里,而是直接放在 `MainActivity`
483+
如果你有安装 `react-native-screens` (使用 `react-navigation` 一般都会要求安装),则安卓端在热更后重启可能会白屏。此时需要在 Android 的 `MainActivity` 中设置 `RNScreensFragmentFactory`,以确保 Fragment 恢复流程一致,避免崩溃。注意不要把这段覆盖写在 `MainActivityDelegate` 里,而是直接放在 `MainActivity`
484484
更多说明可以参考 `react-native-screens` 的 [readme](https://github.com/software-mansion/react-native-screens?tab=readme-ov-file#android)
485485
486486
<Tabs items={['Kotlin', 'Java']}>

0 commit comments

Comments
 (0)