Closed ncwuguowei closed 1 month ago
:warning: | Newer Version of React Native is Available! |
---|---|
:information_source: | You are on a supported minor version, but it looks like there's a newer patch available - 0.73.7. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases. |
upgrade the react version to 0.73.7, the issue also exits.
Hi, @ncwuguowei!
Is there somewhere in the documentation of the new architecture that describes that we can create a turbo module that is not like a library (external folder)?
@ncwuguowei @mensonones Hi there, sorry if it took me a lot of time to get back at you. Currently there is no documentation to do such thing, but it is totally possible as RNTester is doing that. I'll setup a sample repository for an example and I'll report it here.
This is the Sample Repo I put together: https://github.com/cipolleschi/InAppModule
For now, there is only iOS, as that's my expertise. Steps for android should be similar, but step 3 will change as we have to implement the module in Java or Kotlin. I'll be back at that later today or worse case tomorrow.
Android code added here: cipolleschi/InAppModule
The readme explains it step by step.
The results:
Thank you very much for the answer and your work, @cipolleschi
Description
1.use newArch in app 2.create a turboModule in app,but no as a libray in external folder ,then yard add into node_module to be a library(as a library can not use app src and feacture ). 3.modify the root package.json to add codegenConfig add js file to Define Specs in JavaScript ./gradlew generateCodegenArtifactsFromSchema to gererate jni files create implement turboModule and TurboReactPackage add TurboReactPackage to ReactNativeHost packagelist
Steps to reproduce
React Native Version
0.73.7
Affected Platforms
Runtime - Android, Build - Windows
Areas
TurboModule - The New Native Module System
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/ncwuguowei/reproducer-react-native
Screenshots and Videos