react-native

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

React Native

React Native

The skill is based on React Native, generated at 2026-01-31.
React Native lets you build mobile apps using only JavaScript. It uses the same design as React, letting you compose a rich mobile UI from declarative components. With React Native, you don't build a "mobile web app", an "HTML5 app", or a "hybrid app". You build a real mobile app that's indistinguishable from an app built using Objective-C or Java.
本技能基于React Native开发,生成于2026年1月31日。
React Native允许你仅使用JavaScript构建移动应用。它采用与React相同的设计理念,让你通过声明式组件组合出丰富的移动UI界面。使用React Native,你构建的不是“移动Web应用”“HTML5应用”或“混合应用”,而是一款真正的移动应用,其体验与使用Objective-C或Java开发的应用毫无区别。

Core References

核心参考

TopicDescriptionReference
Core ComponentsView, Text, Image, TextInput, ScrollView - fundamental UI building blockscore-components
Layout with FlexboxFlexbox layout system for positioning and aligning componentscore-layout
StylingStyleSheet API for creating and organizing component stylescore-styling
主题描述参考链接
核心组件View、Text、Image、TextInput、ScrollView——基础UI构建模块core-components
Flexbox布局用于组件定位与对齐的Flexbox布局系统core-layout
样式处理用于创建和管理组件样式的StyleSheet APIcore-styling

Features

功能特性

Animations

动画

TopicDescriptionReference
Animated APICreate fluid animations with Animated.Value, timing, spring, and gesture integrationfeatures-animations
Easing FunctionsEasing functions for custom animation curves and natural motionfeatures-easing
主题描述参考链接
Animated API借助Animated.Value、timing、spring以及手势集成创建流畅动画features-animations
缓动函数用于自定义动画曲线和自然运动效果的缓动函数features-easing

User Interactions

用户交互

TopicDescriptionReference
Touch HandlingPressable, Touchable components, and gesture responders for handling user inputfeatures-touch-handling
KeyboardKeyboard API for handling keyboard events, dismissing keyboard, and KeyboardAvoidingViewfeatures-keyboard
主题描述参考链接
触摸处理Pressable、Touchable组件以及手势响应器,用于处理用户输入features-touch-handling
键盘处理用于处理键盘事件、收起键盘以及KeyboardAvoidingView的Keyboard APIfeatures-keyboard

UI Components

UI组件

TopicDescriptionReference
Additional ComponentsModal, Switch, ActivityIndicator, RefreshControl for dialogs, toggles, loading statescomponents-ui
主题描述参考链接
扩展组件Modal、Switch、ActivityIndicator、RefreshControl,用于对话框、开关、加载状态展示components-ui

Data Display

数据展示

TopicDescriptionReference
ListsFlatList and SectionList for efficiently rendering large, scrollable listsfeatures-lists
主题描述参考链接
列表组件FlatList和SectionList,用于高效渲染大型可滚动列表features-lists

Styling and Theming

样式与主题

TopicDescriptionReference
Colors and ThemingColors, PlatformColor, Appearance API for theming and dark mode supportfeatures-colors-theming
主题描述参考链接
颜色与主题Colors、PlatformColor、Appearance API,用于主题配置与深色模式支持features-colors-theming

Platform Integration

平台集成

TopicDescriptionReference
Platform APIsLinking, Dimensions, Platform detection, AppState, and native integrationsfeatures-platform-apis
NetworkFetch API for making HTTP requests and handling network responsesfeatures-network
StatusBarControl status bar appearance, style, and visibilityfeatures-statusbar
Share & VibrationNative share dialog and device vibration for haptic feedbackfeatures-share-vibration
TimerssetTimeout, setInterval, requestAnimationFrame for scheduling and delaysfeatures-timers
Platform-Specific APIsAndroid (PermissionsAndroid, ToastAndroid, DrawerLayoutAndroid) and iOS (ActionSheetIOS)features-platform-specific
主题描述参考链接
平台APILinking、Dimensions、平台检测、AppState以及原生集成能力features-platform-apis
网络请求用于发起HTTP请求和处理网络响应的Fetch APIfeatures-network
状态栏控制控制状态栏的外观、样式与可见性features-statusbar
分享与震动原生分享对话框和设备震动反馈功能features-share-vibration
定时器setTimeout、setInterval、requestAnimationFrame,用于任务调度与延迟执行features-timers
平台专属APIAndroid(PermissionsAndroid、ToastAndroid、DrawerLayoutAndroid)和iOS(ActionSheetIOS)专属APIfeatures-platform-specific

Accessibility

无障碍访问

TopicDescriptionReference
AccessibilityScreen reader support, accessibility labels, roles, and statesfeatures-accessibility
主题描述参考链接
无障碍支持屏幕阅读器支持、无障碍标签、角色与状态配置features-accessibility

Advanced Styling

高级样式

TopicDescriptionReference
Transforms2D and 3D transforms for rotation, scale, translation, and skewfeatures-transforms
主题描述参考链接
变换效果2D与3D变换,支持旋转、缩放、平移与倾斜features-transforms

Best Practices

最佳实践

TopicDescriptionReference
PerformancePerformance optimization techniques, profiling, and common bottlenecksbest-practices-performance
DebuggingDebugging tools, Dev Menu, LogBox, React Native DevTools, and debugging techniquesbest-practices-debugging
主题描述参考链接
性能优化性能优化技巧、性能分析以及常见性能瓶颈解决best-practices-performance
调试技巧调试工具、开发菜单、LogBox、React Native DevTools以及调试方法best-practices-debugging

Key Recommendations

关键建议

  • Use StyleSheet.create() for all styles instead of inline objects
  • Use FlatList instead of ScrollView for long lists
  • Enable useNativeDriver for animations when possible (transform, opacity)
  • Use Pressable for new touch interactions (preferred over Touchable components)
  • Handle platform differences with Platform.select() and Platform.OS
  • Test on real devices - simulator behavior may differ from actual devices
  • Optimize list performance with getItemLayout for fixed-height items
  • Use TypeScript for better type safety and developer experience
  • 所有样式均使用**StyleSheet.create()**创建,而非内联对象
  • 长列表使用FlatList替代ScrollView
  • 尽可能为动画启用useNativeDriver(支持transform、opacity属性)
  • 新的触摸交互场景优先使用Pressable(优于Touchable系列组件)
  • 借助Platform.select()和Platform.OS处理平台差异
  • 在真实设备上进行测试——模拟器表现可能与真实设备存在差异
  • 为固定高度列表项配置getItemLayout以优化列表性能
  • 使用TypeScript提升类型安全性与开发体验