Skip to content

Commit bc8039e

Browse files
authored
SampleTurboModule only works as a turbomodule, so do not install it when using web debugger (#13911)
* SampleTurboModule only works as a turbomodule, so do not install it when using web debugger * Change files * fix
1 parent 00cd64a commit bc8039e

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "SampleTurboModule only works as a turbomodule, so do not install it when using web debugger",
4+
"packageName": "react-native-windows",
5+
"email": "30809111+acoates-ms@users.noreply.github.com",
6+
"dependentChangeType": "patch"
7+
}

vnext/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,9 +400,12 @@ void ReactInstanceWin::LoadModules(
400400
}
401401
#endif
402402

403-
registerTurboModule(
404-
L"SampleTurboModule",
405-
winrt::Microsoft::ReactNative::MakeTurboModuleProvider<::Microsoft::ReactNative::SampleTurboModule>());
403+
if (!m_options.UseWebDebugger()) {
404+
turboModulesProvider->AddModuleProvider(
405+
L"SampleTurboModule",
406+
winrt::Microsoft::ReactNative::MakeTurboModuleProvider<::Microsoft::ReactNative::SampleTurboModule>(),
407+
false);
408+
}
406409

407410
if (devSettings->useTurboModulesOnly) {
408411
::Microsoft::ReactNative::ExceptionsManager::SetRedBoxHander(

0 commit comments

Comments
 (0)