Skip to content

React Native 0.83 template removes ReactNativeHost hook #39

@xchwarze

Description

@xchwarze

In React Native 0.83, the default Android template initializes the app using ReactHost only (getDefaultReactHost(...)) and no longer exposes ReactNativeHost overrides such as getJSBundleFile().

This creates a regression for integrations like CodePush / Revopush (and other custom bundle loaders) that rely on overriding getJSBundleFile() to provide a dynamic JS bundle path.

Issue:
There is no documented or equivalent extension point in the new template to customize the JS bundle location without reintroducing ReactNativeHost.

Any guidance or official migration recommendation would be appreciated.

--- edit
I think this is the answer

  override val reactHost: ReactHost by lazy {
    getDefaultReactHost(
      context = applicationContext,
      packageList =
        PackageList(this).packages.apply {
          // Packages that cannot be autolinked yet can be added manually here, for example:
          // add(MyReactNativePackage())
        },

      // Revopush 2/2
      jsBundleFilePath = CodePush.getJSBundleFile(),
    )
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions