Has this changed recently? It’s been my understanding that react native has corresponding native components for many UI elements and uses them. But your react logic is still executing as JavaScript.
Has this changed recently? It’s been my understanding that react native has corresponding native components for many UI elements and uses them. But your react logic is still executing as JavaScript.
Yes, but this is no different than how native works. On iOS, The JS Bridge compiles to bytecode and talks to the Obj-C runtime for native needs like Cocoa, just as Swift does.
Sure you could get better performance by writing your apps directly in Obj-C, but I don't think many people want to go back to those days.
Some definitions:
- The Obj-C runtime is just a shared library that Swift links to on compilation (/usr/lib/libobjc.A.dylib). The performance to call into it is identical for Swift and Obj-C.
- "Sure you could get better performance by writing your apps directly in Obj-C..." Swift code is native code. Cost to access the runtime is identical.
- There is one "hop" to go from Swift to the Obj-C runtime.
- There are >2 "hops" to go through the JS Bridge. https://hackernoon.com/understanding-react-native-bridge-con...
HN is better without personal attacks and insults.
It could be extended to pretty much anything: "I'm insulting your clothes, not you".
Calling something that a person says, or writes "asinine" is inflammatory. If I were to call your defense of it "naive, brain dead and utterly absurd" are you sure you wouldn't interpret that as a personal attack?
Yes, inflammatory. But personal, no.
> If I were to call your defense of it "naive, brain dead and utterly absurd" are you sure you wouldn't interpret that as a personal attack?
Correct, because it's not personal. That would be attacking the quality of the argument, not me, although it would certainly be inflammatory. I certainly wouldn't take it well — but for a totally different reason than you originally specified.
"Personal" and "inflammatory" are two different things.
Web won’t beat native on mobile phones, I’m sorry this argument has been had every single year it’s just absurd we keep arguing about it.
RN is implemented due to developer productivity at the cost of user experience. Which is fine more power to you, but understand that it doesn’t imply better UX.
The barriers to creating apps is also getting smaller (SwiftUI & Jetpack Compose).
Source: Multiple years working on Core Apple systems at Apple and also multiple years at Google
Honestly, it won't beat anything anywhere, but people do keep on trying to make it work.
RN doesn't "compile" the Javascript to bytecode or machine code. Instead, the closest competition you could get from RN is a JIT. But AFAIK iOS doesn't allow a Javascript JIT to run, so the JavaScript running is not being JITed to Bytecode.
Even if you assume that iOS allows a JS JIT now, you still have a JavaScript->Native bridge to cross. This adds a performance hit that Objective-C does not have.