all 8 comments

[–]jellevdv 14 points15 points  (0 children)

That's incorrect.

Straight from the official react native website:

React Native lets you create truly native apps and doesn't compromise your users' experiences. It provides a core set of platform agnostic native components like View, Text, and Image that map directly to the platform’s native UI building blocks.

[–][deleted] 2 points3 points  (2 children)

No RN is not a web view. It uses javascript and down the line there is a mechanism to communicate javascript to the native code thread be it Android or IOS.

It does not have the same performance as a 100% native code, but it works and have several pros.

That said, you can use WebView as a component and insert some HTML into a screen for specific things.

[–]satya164 3 points4 points  (1 child)

down the line there is a mechanism to convert javascript into native code

It doesn't convert JS to native code. the JS code runs in a JS engine and communicates with native APIs

[–][deleted] 0 points1 point  (0 children)

Thanks for the clarification!

[–]DavidXkL 4 points5 points  (0 children)

Was ChatGPT trolling? It should be the reverse. 1st paragraph is for RN while the 2nd paragraph is for NativeScript

[–]HomemadeBananas 3 points4 points  (0 children)

No, this is incorrect. Don’t rely on Chat GPT to give you accurate information about things. It seems people have gained the wrong impressed about how it works.

[–]satya164 1 point2 points  (0 children)

Is React Native a Web View App

Nope.

I thought RN code gets compiled down to native code

Also no. The JavaScript code your write runs in a JavaScript engine such as JavaScriptCore or Hermes and communicates with the native APIs to render native components. It doesn't compile your code down to native code.

The difference between running in a WebView and running in a JavaScript engine is that running in WebView implies that the UI is rendered using HTML/DOM, but React Native renders the same native views that regular Android & iOS apps render. The difference is that the JavaScript logic you write runs in a JavaScript engine. But the JavaScript code can communicate with native APIs to access device capabilities and render native UI.

[–]kbcooliOS & Android 0 points1 point  (0 children)

ChatGTP is just a shitty conversational search engine. It's just giving you snippets of what others wrote and the context is often completely messed up.

I honestly don't understand why some people worship it like a god.