React Native Documentation

website·Indexed 33 days ago

https://reactnative.cn/

Official documentation for React Native, covering core components like Text, ScrollView, and Pressable, as well as the New Architecture including Turbo Native Modules and Fabric Native Components. Includes guides on platform-specific integration for iOS and Android, DevTools, and API references for global Web specifications.

Tokens
2.9M
Snippets
12.9K
Records
21.7K
Agent score
42%

What's inside React Native

  1. Overview of React Native Easing functions

    The Easing module provides predefined easing functions used with Animated.timing() to control the rate of change of an animation over time. These functions can be categorized into preset animations (like bounce or elastic), standard mathematical functions (linear, quad, cubic), and supplementary functions (bezier, circle, sin, exp).
  2. Overview of React Native Codegen

    Codegen is a tool in the React Native New Architecture used to avoid writing repetitive boilerplate code for TurboModules and Fabric Components. While not strictly mandatory (developers can write the generated code by hand), it significantly reduces development time. Codegen is typically invoked automatically during the App build process, but can be executed manually to declare required types and files.
  3. Overview of React Native Easing functions

    The Easing module provides various easing functions used by Animated.timing() to define the rate of change of an animation over time. These functions are categorized into preset animations, standard functions, mathematical functions, and modifiers.
  4. Overview of the View component

    The View component is the fundamental building block for UI in React Native. It serves as a container that supports Flexbox layout, styling, touch responses, and accessibility features. It maps directly to the native view of the target platform: UIView on iOS, div on Web, and android.view.View on Android. View components can be nested and can contain any number of child views of any type.
  5. Overview of the Animated API

    The Animated API allows developers to create high-performance, declarative animations in React Native. It is designed to define animation inputs and outputs via a configurable change function, controlled by start() and stop() methods. To avoid the overhead of frequent setState calls and re-renders, Animated uses a specialized system that can be optimized by serializing configurations to a high-priority thread.

    Animated provides built-in support for the following components:

    • View
    • Text
    • Image
    • ScrollView
    • FlatList
    • SectionList

    Custom components can be made animatable using Animated.createAnimatedComponent().

  6. Overview of AccessibilityInfo

    AccessibilityInfo is used to determine if a user's device is running a screen reader and to monitor changes in accessibility settings. It provides a set of static methods to query current states and an event listener to react to changes in real-time.
  7. Overview of Bundled Hermes in React Native

    Hermes is an open-source JavaScript engine optimized for React Native apps, designed to improve startup time and reduce memory and storage usage. Since React Native 0.70, Hermes is enabled by default. React Native now provides a bundled version of Hermes that is guaranteed to be compatible with the specific version of React Native you are using, eliminating version mismatch issues.
  8. Overview of Bundled Hermes in React Native

    Hermes is an open-source JavaScript engine optimized for React Native apps, improving startup time, memory usage, and app size. Since React Native 0.70, Hermes is enabled by default. React Native provides a bundled version of Hermes that is guaranteed to be compatible with the specific version of React Native being used.
  9. Overview of the Fabric Render Pipeline

    The React Native render pipeline transforms React code into host platform UI through three primary phases:

    1. Render Phase: React executes logic in JavaScript to create React Element Trees. In C++, these are used to create the React Shadow Tree.
    2. Commit Phase: Once the Shadow Tree is complete, the renderer triggers a commit. This involves calculating layout information (via the Yoga engine) and promoting the new Shadow Tree to the 'Next Tree' to be mounted.
    3. Mount Phase: The Shadow Tree (now containing layout data) is converted into a Host View Tree (e.g., Android ViewGroup or iOS UIView) and rendered as pixels on the screen.
  10. Overview of SectionList component

    SectionList is a high-performance list component designed for grouped data. It is a wrapper around VirtualizedList and inherits all of its props, as well as all ScrollView props. It is suitable for cross-platform use and supports features like sticky section headers, custom separators, pull-to-refresh, and infinite scrolling. If grouping is not required, FlatList is recommended as a simpler alternative.
  11. Overview of creating a Turbo Native Module

    Turbo Native Modules allow React Native applications to interact with native platform APIs. The development process follows four primary steps: defining a typed JavaScript specification, configuring Codegen to generate native interfaces, writing the application code using that specification, and implementing the native platform logic.
  12. Overview of React Native Animated API

    The Animated library provides a way to create fluid, declarative animations in React Native. The basic workflow involves creating an Animated.Value, linking it to style properties of an animated component, and using animation functions like Animated.timing() to drive the value change. To avoid unnecessary re-renders and maintain a persistent reference to the animation value across component lifecycles, it is recommended to use the useRef hook.