Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix native modules not being re-initialized on reload #6159

Merged
2 commits merged into from
Oct 2, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions vnext/Microsoft.ReactNative/ReactNativeHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,16 @@ IAsyncAction ReactNativeHost::ReloadInstance() noexcept {

auto turboModulesProvider = std::make_shared<TurboModulesProvider>();

if (!m_packageBuilder) {
m_packageBuilder = make<ReactPackageBuilder>(
modulesProvider,
m_packageBuilder = make<ReactPackageBuilder>(
modulesProvider,
#ifndef CORE_ABI
viewManagersProvider,
viewManagersProvider,
#endif
turboModulesProvider);
turboModulesProvider);

if (auto packageProviders = InstanceSettings().PackageProviders()) {
for (auto const &packageProvider : packageProviders) {
packageProvider.CreatePackage(m_packageBuilder);
}
if (auto packageProviders = InstanceSettings().PackageProviders()) {
for (auto const &packageProvider : packageProviders) {
packageProvider.CreatePackage(m_packageBuilder);
}
}

Expand Down