Cơ BảnReact Native iconReact Native

React Native khác gì so với ReactJS?

ReactJS là thư viện JavaScript render ra DOM trong browser, output là HTML/CSS. React Native là framework dùng cùng model component + JSX nhưng render ra native UI components (UIView trên iOS, ViewGroup/Android.View trên Android), không có DOM, không có HTML tag.

Khác biệt cụ thể:
- Tag: Web dùng <div>/<p>/<button>; RN dùng <View>/<Text>/<Pressable>. Mọi text bắt buộc nằm trong <Text> — viết text trần trong <View> là crash.
- Style: Web dùng CSS file/inline với units px/rem/%; RN dùng StyleSheet.create() với object JS, đơn vị là DIP (density-independent pixels), không có cascading, không có display: block/inline, default flexDirection: column.
- Routing: Web dùng react-router/Next.js; RN dùng react-navigation (stack/tab/drawer).
- Build: Web build ra HTML+JS bundle; RN build ra binary .ipa/.apk qua Metro bundler + native toolchain (Xcode/Gradle).
- API: RN có thêm Platform, Dimensions, AppState, AsyncStorage, không có window/document.

Điểm chung: hooks, JSX, component composition, props/state, context — code logic gần như copy-paste được.

Xem toàn bộ React Native cùng filter theo level & chủ đề con.

Mở danh sách React Native