Linking a "local library" #13275
-
We are trying to work with an RN "local library" (that is, one under The problem manifests with Here is a simple project that replicates the problem: https://github.com/adam-p/react-native-windows-locallib It is mostly sample/generated code. One thing to note is that we're not using Turbo at all (as the real project doesn't yet use it). Is that a fatal problem? We'd appreciate any help with this. Everything looks to us like it should work, and we've tried a hundred things to try to get it linking, but it just keeps giving us the same error. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
In ReactPackageProvider.cpp, the 2nd argument to AddAttributedModules, specifies that you want to register those modules as TurboModules, not NativeModules. You could try changing that to false. Alternatively, instead of moving the code backwards (to be a nativemodule instead of a turbomodule) you could go ahead and make the JS code use TurboModuleRegistry.get('AwesomeModule') instead of NativeModules.AwesomeModule. That JS code will work if the module is a NativeModule or a TurboModule, so should work on windows as a TurboModule and continue to work on the other platforms where you are using NativeModules. |
Beta Was this translation helpful? Give feedback.
In ReactPackageProvider.cpp, the 2nd argument to AddAttributedModules, specifies that you want to register those modules as TurboModules, not NativeModules.
You could try changing that to false.
Alternatively, instead of moving the code backwards (to be a nativemodule instead of a turbomodule) you could go ahead and make the JS code use TurboModuleRegistry.get('AwesomeModule') instead of NativeModules.AwesomeModule. That JS code will work if the module is a NativeModule or a TurboModule, so should work on windows as a TurboModule and continue to work on the other platforms where you are using NativeModules.