Skip to content

Commit

Permalink
6/n Boilerplate C++-only TurboModule iOS
Browse files Browse the repository at this point in the history
Summary:
C++-only TurboModules, not to be confused with [TurboModules](https://www.internalfb.com/intern/wiki/React_Native/Building_Product_Experiences/Intro_to_Native_Modules/), directly allows you to call C++ from JS instead of going through the native layer. Referred to modification of C++-only TurboModule D30158226 and https://fburl.com/code/rcf73a42 for C++ to JS call (jsInvoker is an object that can schedule work on the JavaScript thread)

This example shows JS to C++ call and storing a JS function in C++ to call later.

Notes:

* To use the module, import the C++ module directly in objc.
* Meanwhile, create a js spec and use it in RN code. Spec methods don't need to be marked as optional.
* C++ and js spec will be linked when built

Reviewed By: RSNara

Differential Revision: D32080496

fbshipit-source-id: 9c214ca22c18f793d5f8b54997d129bdfa73e61a
  • Loading branch information
rachellangfb authored and facebook-github-bot committed Nov 4, 2021
1 parent e918362 commit 88ebec9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ rn_xplat_cxx_library2(
"//xplat/js/react-native-github/ReactCommon/react/nativemodule/core:",
"//xplat/js/react-native-github/ReactCommon/react/nativemodule/samples:",
"//xplat/js/react-native-github/packages/rn-tester:",
"//xplat/rtc/manul/...",
],
deps = [
YOGA_CXX_TARGET,
Expand Down

0 comments on commit 88ebec9

Please sign in to comment.