React Native is a framework developed by Meta (formerly Facebook) for building mobile applications using JavaScript and React. It allows developers to create cross-platform apps that work on iOS and Android using a single codebase.
React (or React.js) is a JavaScript library used for building web applications with a component-based architecture. It focuses on building interactive user interfaces (UIs) efficiently.
Feature | React (React.js) | React Native |
---|---|---|
Platform | Web applications | Mobile applications (iOS, Android) |
Rendering | Uses the DOM (Document Object Model) | Uses Native Components (e.g., <View> instead of <div> ) |
Styling | Uses CSS, SCSS, styled-components | Uses StyleSheet API (similar to inline styles in JS) |
Navigation | Uses React Router for routing | Uses React Navigation or Native Navigation |
Performance | Renders using the browser engine | Uses native components, making it faster than web apps |
APIs & Libraries | Uses browser APIs (e.g., fetch, localStorage) | Has access to mobile-specific APIs (e.g., camera, geolocation, push notifications) |
Compilation | Runs in the browser without additional compilation | Uses a bridge to convert JavaScript into native code |