React Native
Framework for developing Android and IOS applications
React Native is a framework for developing native Android and iOS applications using JavaScript and React.
It provides a set of cross-platform components that behind the scenes utilize the platform's native components.
Using React Native allows us to bring all the familiar features of React such as JSX, components, props, state, and hooks into native application development.
On top of that, we can utilize many familiar libraries in the React ecosystem such as React Redux, Apollo, React Router and many more.
How React Native differs from React
- React renders to the DOM (
<div>,<span>, ...). React Native renders to native platform views — there is no DOM or HTML. Instead of<div>and<span>you use components likeViewandText. - Styling is done with
StyleSheetand a Flexbox-based layout system instead of CSS. - Instead of a browser runtime, your JS code runs on a JavaScript engine embedded in the native app and talks to native modules through a bridge (or JSI in the New Architecture), rather than through browser APIs.
Components
React Native ships a set of built-in, cross-platform Core Components such as View, Text, Image, ScrollView, TextInput and Pressable. Each one maps to a real native view on iOS and Android behind the scenes. You compose them together — and with your own components — the same way you would with regular React.
APIs
Besides components, React Native provides a set of built-in APIs for things a browser would normally give you for free — see User interface for how they're used in practice. The most common ones are:
StyleSheet— define and validate styles.Platform— branch logic or styles based on iOS vs Android.Dimensions— read the screen width/height.Alert— show a native alert dialog.Animated— drive simple animations.