gitmyhub

react-native-screens

TypeScript ★ 3.7k updated 1d ago

Native navigation primitives for your React Native app.

React Native Screens is a library that helps mobile app developers build smoother navigation in React Native apps by using the phone's own built-in screen management instead of a custom JavaScript version. When a user taps to a new page in an app, the transition and the memory handling can be managed by the operating system directly, which tends to feel more natural and perform better than a purely JavaScript-driven approach.

This library is not something you use on its own to build navigation from scratch. It works as a low-level building block that popular navigation tools, most notably the React Navigation library, rely on underneath. If you are a developer using React Navigation, adding React Native Screens as a dependency is usually all you need to do, and the navigation tool will automatically start using native screen management instead of plain views.

The library supports iOS, Android, tvOS, visionOS, Windows, and Web. Installation on iOS and modern versions of Android and Windows is handled automatically when you set up the project. Android requires one small code addition to a specific file to avoid crashes when the operating system restarts the app, for example after a screen rotation or a phone call.

One additional feature the library includes is experimental support for freezing off-screen content. When a user navigates away from a page, that page's content can be paused rather than re-rendered in the background, which saves processing work without losing the page's current state. Developers opt into this separately since it is still experimental.

The library is maintained by Software Mansion, a development studio, and it tracks closely with the React Native release cycle. Version 4.25 and later dropped support for the older rendering system, so developers still on the legacy architecture need to stay on an older version.