Skip to content

Create multiple Cxx TurboModules in same package #283

Answered by cortinico
mbpictures asked this question in Q&A
Discussion options

You must be logged in to vote

Does anyone know how to add multiple C++ TurboModules in an npm package? I think I can merge all the definitions, but this would result in a really large and kinda messy module...

This is sadly not supported at the moment. As we need to generate a lot of C++ code for this to work, the initial implementation of Autolinking for pure C++ TM, was done under the assumption that there would be one module per NPM package.

You should create a separate package for NativeA and NativeB as they will generate separate module provider and need to be both autolinked.

The react-native.config.js file also allows for a single module and not an array of them.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@mbpictures
Comment options

@cortinico
Comment options

Answer selected by cortinico
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants