diff --git a/change/react-native-windows-e855b870-df35-4590-b34c-73c5b09f39b7.json b/change/react-native-windows-e855b870-df35-4590-b34c-73c5b09f39b7.json new file mode 100644 index 00000000000..683ae98220e --- /dev/null +++ b/change/react-native-windows-e855b870-df35-4590-b34c-73c5b09f39b7.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Fix unused function warning", + "packageName": "react-native-windows", + "email": "30809111+acoates-ms@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/vnext/Microsoft.ReactNative.Cxx/ModuleRegistration.h b/vnext/Microsoft.ReactNative.Cxx/ModuleRegistration.h index 5dce3d0bbd1..16745d8888d 100644 --- a/vnext/Microsoft.ReactNative.Cxx/ModuleRegistration.h +++ b/vnext/Microsoft.ReactNative.Cxx/ModuleRegistration.h @@ -70,16 +70,16 @@ struct IsReactTurboModule : std::bool_constant \ - constexpr void GetReactModuleInfo(moduleStruct *, TRegistry ®istry) noexcept { \ - registry.RegisterModule( \ - moduleName, eventEmitterName, winrt::Microsoft::ReactNative::ReactAttributeId<__COUNTER__>{}); \ +#define INTERNAL_REACT_MODULE_NO_REGISTRATION_AND_PROVIDER( \ + moduleStruct, moduleName, eventEmitterName, isReactTurboModule) \ + struct moduleStruct; \ + \ + [[maybe_unused]] constexpr bool ReactIsReactTurboModuleImpl(moduleStruct *) noexcept { return isReactTurboModule; } \ + \ + template \ + constexpr void GetReactModuleInfo(moduleStruct *, TRegistry ®istry) noexcept { \ + registry.RegisterModule( \ + moduleName, eventEmitterName, winrt::Microsoft::ReactNative::ReactAttributeId<__COUNTER__>{}); \ } // Another version of REACT_MODULE but does not do auto registration