Skip to content

fix: use react-native-safe-area-context instead of deprecated SafeAreaView#395

Open
yocontra wants to merge 1 commit intonandorojo:masterfrom
yocontra:fix/safe-area-view-deprecation
Open

fix: use react-native-safe-area-context instead of deprecated SafeAreaView#395
yocontra wants to merge 1 commit intonandorojo:masterfrom
yocontra:fix/safe-area-view-deprecation

Conversation

@yocontra
Copy link

@yocontra yocontra commented Jan 30, 2026

Summary

  • Replace deprecated SafeAreaView import from react-native with react-native-safe-area-context
  • Add react-native-safe-area-context as a peer dependency

Problem

SafeAreaView from react-native has been deprecated and will be removed in a future release. The React Native team recommends using react-native-safe-area-context instead.

Additionally, this causes a development warning to appear even when SafeAreaView is not directly used. When importing anything from moti, React Fast Refresh enumerates all exports which triggers the deprecation getter for SafeAreaView.

Solution

Import SafeAreaView from react-native-safe-area-context instead of react-native. Added as a peer dependency since most React Native projects already have it installed (it's required by React Navigation and other common libraries).

…aView

SafeAreaView from react-native has been deprecated and will be removed
in a future release. This change updates the import to use the
recommended react-native-safe-area-context package instead.

This also fixes a development warning that appears because React Fast
Refresh enumerates all exports from moti, triggering the deprecation
getter even when SafeAreaView is not directly used.

Added react-native-safe-area-context as a peer dependency.
@vercel
Copy link

vercel bot commented Jan 30, 2026

@yocontra is attempting to deploy a commit to the Fernando Rojo's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant