-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cxx TurboModules > Add example to return a JS function from Cxx to JS (…
…#41385) Summary: Pull Request resolved: #41385 Changelog: Internal Adding a Cxx TM example which adds a listener and returns a subscription to remove that listener from the TM. You should be able to use this with React Hooks - https://legacy.reactjs.org/docs/hooks-reference.html E.g. ``` useEffect(() => { const subscription = NativeCxxModuleExample.setValueCallbackWithSubscription( callbackValue => // use it ); return subscription; }); ``` Reviewed By: shwanton Differential Revision: D50473063 fbshipit-source-id: 4e9b92aeccff1771eb4ffad6bdaa20ba7f18435f
- Loading branch information
1 parent
01b4d78
commit 9320174
Showing
4 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters