How do you structure your library to incorporate codegen generated C++ code and custom C++ code for Fabric components? #259
Replies: 3 comments
-
I'm assuming that |
Beta Was this translation helpful? Give feedback.
-
Based on react-native-slider's CMakeLists.txt, it looks like it's pulling in all the auto-generated C++ code and the manual C++ code. Codegen generates two files called Does any of this sound right or wrong? |
Beta Was this translation helpful? Give feedback.
-
I think I got the setup correct. |
Beta Was this translation helpful? Give feedback.
-
I'm working on a library with Fabric components and Turbo Modules. Some of the Fabric components can use the default generated C++ code because height and width measurements will be provided from the JS side. Other components have intrinsic sizing that the native component should communicate to Yoga.
In the new architecture, this has to be done via ShadowNodes in C++. I've found examples like react-native-slider that declare the native component to be
interfaceOnly: true
. This means codegen won't generate all the C++ code for it. It is manually written and added to the library.How do I setup the C++ code to use both the Codegen generated code (like
ComponentDescriptors
,EventEmitters
,Props
,ShadowNodes
andStates
) and manual written C++ code for components that need to provide sizing to Yoga?The two thoughts I have are:
Beta Was this translation helpful? Give feedback.
All reactions