Skip to content

fix(android): restore hard restart behavior - #301

Open
vmarkuts wants to merge 1 commit into
avishayil:masterfrom
vmarkuts:fix/android-hard-restart
Open

fix(android): restore hard restart behavior#301
vmarkuts wants to merge 1 commit into
avishayil:masterfrom
vmarkuts:fix/android-hard-restart

Conversation

@vmarkuts

Copy link
Copy Markdown

Android restart() stopped performing a real process restart in 0.0.28 and started reloading the React context instead.

That caused two regressions:

  • native state was no longer reinitialized
  • under the New Architecture/bridgeless mode, the fallback could recreate the Activity without resetting the JS runtime

This PR restores the previous Android behavior using ProcessPhoenix.triggerRebirth(). Since the whole process is restarted, it works independently of ReactNativeHost or ReactHost and supports both the legacy and New Architecture paths.

The optional restart reason is persisted before the process is terminated and restored when the application starts again, so the API introduced in 0.0.28 is preserved.

Also included:

  • corrected TypeScript definitions for the optional reason
  • tests verifying that the reason is passed to the native module
  • documentation of the platform-specific restart behavior

Validated with Android compilation against:

  • React Native 0.81.1
  • React Native 0.85.3
  • React Native 0.86.0

Jest, TypeScript, ESLint, and the package build also pass.

Closes #292
Closes #300

@vmarkuts
vmarkuts marked this pull request as ready for review July 29, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant