When we mix native and React Native components, we eventually find the need to communicate between these two worlds. In this section we’ll explain the concept of the bridge, show how it can affect app performance and what kind of data can be passed through it back and forth.
The native code in React Native is mostly written in Objective C and Java. These languages have been available in the market for a very long time, but as time passes, industry standards change. It’s perfectly fine to use new languages for each platform – our goal is to present you with all the pros and cons.
It’s time to get our hands dirty and write some code. We’ll create our first native module with Swift. Participants will learn how to invoke native functions from JS, export constants and send events from native to JS.
In this section we’ll show how to push a React Native screen to a native navigation stack. We’ll create a simple native layout and push the React Native view to the stack. We’ll also show how to pre-initialize the bridge to match the native navigation user experience.