How it works...
The app we built in this recipe will serve as the foundation for many of the following recipes in this chapter. It's also the method Facebook uses to implement many bundled React Native APIs.
There are several important concepts to keep in mind going forward. Any native module class we want to use in the JavaScript layer has to extend RCTBridgeModule, as it contains functionality for registering our class onto the React Native bridge. We register our class with the RCT_EXPORT_MODULE method call, which registers methods on the module once the module has been registered. Registering the module along with its respective methods and properties is what allows us to interface with the native layer from the JavaScript layer.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access