As you begin writing exciting and engaging React Native applications, you will get to a point where you need to execute some code on the native layer. This could be anything from executing some data processing that is better suited to the native layer instead of JavaScript for performance, accessing some native functionality that is not exposed, such as file I/O, or leveraging existing native code from other applications or libraries in your React Native app.
This recipe will walk you through the process of executing some native Objective-C or Swift code and communicating with the JavaScript layer. We will build a native HelloManager
module that will greet our user with a message. We will also show how to execute native Objective-C and Swift code, taking in arguments, and showing several ways of communicating back with the UI (JavaScript) layer.