The code remains the JavaScript native code and is not converted into any other format. The hybrid apps run inside the native container app which invokes JavaScript run time engine which takes care of executing the JavaScript code. I hope this clarifies the question.
Basically, you write Javascript. The Javascript communicates with native components (Java on Android, Objective C on iOS, C# on Windows).
The communication occurs through the so-called "bridge". If at any time you feel that this communication slows things down too much, you can choose to implement the Javascript functionality in Java, Objective C, or C# respectively in order to run purely native. In this case, you are writing directly in native code, so there's no Javascript to native compilation.
This will sacrifice compatibility for performance. Normally, this is not necessary.
React Native works as a wrapper. For example: if you wanted to put a button in your layout, you'd simply add a button tag. You then use a specific API from the UI module to render this on Android. You can easily create custom native modules to use in your React Native projects. However, code written natively is often faster.
Essentially, React Native can be considered as a set of React
components, where each component represents the corresponding native
views and components.
Also there is two parts in React Native architechture:
Native Code/Modules: Most of the native code in case of iOS is written in Objective C or Swift, while in the case of Android it is
written in Java. But for writing our React Native app, we would hardly
ever need to write native code for iOS or Android.
Javascript VM: The JS Virtual Machine that runs all our JavaScript code. On iOS/Android simulators and devices React Native
uses JavaScriptCore, which is the JavaScript engine that powers
Safari. JavaScriptCore is an open source JavaScript engine originally
built for WebKit. In case of iOS, React Native uses the JavaScriptCore
provided by the iOS platform. It was first introduced in iOS 7 along
with OS X Mavericks.
And for communication between these parts:
React Native Bridge: React Native bridge is a C++/Java bridge which is
responsible for communication between the native and Javascript
thread. A custom protocol is used for message passing.
"In react native app after compiled - all the UI(Buttons,Text...) going
to get compiled to native code(Java or Objective C) and the JavaScript part is going to
stay JavaScript."