react-native-screens is a foundational library for React Native that exposes native screen lifecycle management and view hierarchy optimization directly to JavaScript. It enables navigation libraries, such as React Navigation, to leverage platform-specific navigation primitives for improved performance, smoother transitions, and a more native look and feel. The current stable version is 4.24.0, with minor releases occurring frequently (roughly monthly) as development progresses towards a 5.0 stack implementation. A key differentiator is its focus on utilizing native APIs, which contrasts with purely JavaScript-driven navigation solutions. Notably, version 4.24.0 is the last release tested with React Native's 'legacy architecture'; upcoming versions (from 4.25.0) will drop support for older React Native versions (below 0.82) and the legacy architecture, signaling a shift towards the New Architecture (Fabric).
npm install react-native-screensVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to initialize `react-native-screens` with `enableScreens()`, and use `ScreenContainer` to manage basic `Screen` components with header configurations, simulating screen activation through state changes.
Upgrade your React Native project to version 0.82 or newer and migrate to the New Architecture (Fabric) before updating `react-native-screens` past 4.24.0.
Refer to the 'Installation' section of the `react-native-screens` README for the most current Android setup instructions and ensure your project configuration matches.
Migrate any usage of the deprecated `native-stack v5` APIs to the current stable or recommended experimental stack APIs before upgrading.
Avoid experimental APIs in production environments or thoroughly test your application and be prepared for potential breaking changes in minor updates when using these features.
Ensure auto-linking is working (rebuild with `npx react-native run-android`/`ios`). For manual linking issues, check your `Podfile` (iOS) and `build.gradle` (Android) for correct `react-native-screens` entries and clean/rebuild native projects.
Verify `react-native-screens` is correctly installed and linked. Clean build caches (`yarn cache clean --force`, `watchman watch-del-all`, `rm -rf node_modules && yarn install`, `cd ios && pod install --repo-update && cd ..`, clean Xcode build folder, clear Metro cache).
Ensure `enableScreens` is imported as a named export: `import { enableScreens } from 'react-native-screens';`. For CommonJS, use `const { enableScreens } = require('react-native-screens');`. Confirm `enableScreens()` is called once, early in your app lifecycle.