react-native-screens
Native navigation primitives for React Native with performance optimizations.
3. Used by agents' projects
Dependency in 117 public GitHub projects set up for AI coding agents that we scanned (1.9%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
docs.swmansion.com/react-native-screens/llms.txtFrom the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error
What react-native-screens does
react-native-screens is not a navigator you call yourself. It is Software Mansion's layer of native screen containers under React Navigation and Expo Router, and most apps get it by adding one dependency.
react-native-screens popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How react-native-screens is used
- react-native-screens is a dependency in 117 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (2.4% of the 4,867 JavaScript/TypeScript ones), #4 of 105 in desktop and mobile apps.
- Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 191; those are left out of every share on this page.
- Projects that use it most often also use React Native (100.0%), react-native-safe-area-context (100.0%), Expo (94.9%).
By coding agent
Often used with
react-native-screens in practice
Strengths
The README says the native stack navigator primitive for React Navigation is built on <code>UINavigationController</code> on iOS and <code>Fragment</code> on Android. For React Navigation v6 and later, it points to the Native Stack Navigator docs.
The README says screens support is built into react-navigation from 2.14.0 for all navigator types (stack, tab, drawer, etc). You add the library as a dependency. Then, "when screens are enabled in your application code", react-navigation uses native screens instead of plain Views.
The README checks off six supported platforms. These include tvOS and visionOS alongside the two phone platforms.
Since v3.9.0, <code>enableFreeze(true)</code> in the entry file turns on react-freeze. It stops parts of the tree from rendering while keeping their state. The README labels this experimental. It requires React Native 0.68 or higher, react-navigation 5.x or 6.x, and react-native-screens v3.9.0 or later.
Watch out for
The README recommends an override in <code>MainActivity</code> that sets <code>RNScreensFragmentFactory</code>. Without it, Activity restarts can lead to crashes. The code must go directly in <code>MainActivity</code>, not in <code>MainActivityDelegate</code>.
The README's Paper table marks 4.25.0+ as "NOT SUPPORTED". The rows below it list older ranges that do run with the legacy architecture turned on, such as 4.19.0+ with react-native 0.80.0+.
The 4.x compatibility tables map each library version to a minimum react-native version. On Fabric, for example, 4.26.0+ needs react-native 0.84.0+. Compat tables for 3.x live on the 3.x branch.
Android MainActivity override to avoid restart crashes (Kotlin)
import android.os.Bundle;
import com.swmansion.rnscreens.fragment.restoration.RNScreensFragmentFactory;
class MainActivity: ReactActivity() {
//...code
//react-native-screens override
override fun onCreate(savedInstanceState: Bundle?) {
supportFragmentManager.fragmentFactory = RNScreensFragmentFactory()
super.onCreate(savedInstanceState);
}
}More about react-native-screens
Funding
- GitHub Sponsors: https://github.com/software-mansion
- 10 GitHub sponsors
Packages around it
- react-native: Core framework
- react-native-safe-area-context: Safe area insets
- expo: App platform and tooling
- react-native-reanimated: Animations
- react-native-gesture-handler: Native gestures
- react: UI library
Alternatives
react-native-screens This page
Get started
Install it.
npm install react-native-screensRules for your agent
## react-native-screens
- Treat it as a dependency of a navigation library, not a standalone navigator. Install with `yarn add react-native-screens` (bare) or `npx expo install react-native-screens` (Expo managed workflow).
- On Android, add the `RNScreensFragmentFactory` override in `onCreate` directly in `MainActivity`, never inside `MainActivityDelegate`.
- Import the native stack from `@react-navigation/native-stack`. Do not use `react-native-screens/native-stack`, which is deprecated.
- Match the library version to the react-native version using the README tables. Do not use 4.25.0+ on an app with the legacy (Paper) architecture turned on.
- For the listed iOS header issues with a search bar or large title, use a `ScrollView` with `contentInsetAdjustmentBehavior="automatic"` as the screen's main container and set `headerTranslucent: true`.
- To opt out, call `enableScreens(false)` in the entry file, or use `detachInactiveScreens` on a single navigator.
- If you set `kotlinVersion` in `android/build.gradle`, it must be Kotlin 1.3.50 or higher.