4 ms·
Can someone tell me how React Native is actually working? My initial guess is that it is basically running the same JS in a browser wrapped into a native GUI w
by hiram112 8y ago
Can someone tell me how React Native is actually working?
My initial guess is that it is basically running the same JS in a browser wrapped into a native GUI widget (win32, X, Cocoa, etc).
Maybe I'm getting long in the years, but seems like we've played this game many times.
- untog 8y agoIt isn't. It's using a native JS engine entirely separate from the browser, and hooking into the required native APIs.
- ljm 8y agoIn the simplest terms, it renders native UI (the JSX part maps to UI components that the iOS and Android frameworks provide) but it maintains a bridge so that you can write your business logic in JS and have it work against those native components (as far as I understand it). It's not the same as using a web widget as your main interface and having it render the same kind of HTML and CSS you deploy on the web.
- 75dvtwin 8y ago@hiram112. React native works in a 'conceptually' similar way as wxWidgets (if you are familiar with with that). It uses platform's native APIs. It does not rely on a web browser on your mobile device. The integration is also not just for widgets, but underneath it abstracts out Image, network api, basic storage/preference primitives, screen rotation, etc. For the things that it does not abstract, it let's you write a native module, that you register with RN runtime, and then the APIs for your native module will be avialable to your RN java script code. There is an active opensource ecosystem of RN-modules that you can leverage, that will work on Android and IoS , abstracting the platform specific things that RN does not do yet themselves. Everything from non trivial camera interactions to bluetooth specific things. Eg https://github.com/Polidea/react-native-ble-plx https://github.com/Polidea/react-native-ble-plx