Registry / react-native-is-edge-to-edge
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
isEdgeToEdge
✓ import { isEdgeToEdge } from 'react-native-is-edge-to-edge';
✗ const isEdgeToEdge = require('react-native-is-edge-to-edge').isEdgeToEdge;
Primary function to check if the main `react-native-edge-to-edge` library is active.
controlEdgeToEdgeValues
✓ import { controlEdgeToEdgeValues } from 'react-native-is-edge-to-edge';
✗ const { controlEdgeToEdgeValues } = require('react-native-is-edge-to-edge');
A utility function for library authors to warn users about redundant translucency props when edge-to-edge is active.
isEdgeToEdgeFromLibrary
✓ import { isEdgeToEdgeFromLibrary } from 'react-native-is-edge-to-edge';
✗ import isEdgeToEdgeFromLibrary from 'react-native-is-edge-to-edge/isEdgeToEdgeFromLibrary';
One of the internal checks used by `isEdgeToEdge()`, useful for granular detection methods.
This example demonstrates how a library component can use `isEdgeToEdge()` to adapt its behavior and warn users about redundant props, ensuring compatibility with the main `react-native-edge-to-edge` library.
import React from 'react';
import { View, Text, StyleSheet } from 'react-native';
import {
controlEdgeToEdgeValues,
isEdgeToEdge,
isEdgeToEdgeFromLibrary, // Useful for granular checks if needed
isEdgeToEdgeFromProperty, // Checks a specific property flag
} from "react-native-is-edge-to-edge";
// Determine if react-native-edge-to-edge is active in the current environment.
// This is the primary function for most library authors.
const IS_EDGE_TO_EDGE_ACTIVE = isEdgeToEdge();
interface MyLibraryComponentProps {
// These props might be passed by the user of your library.
statusBarTranslucent?: boolean;
navigationBarTranslucent?: boolean;
}
// A hypothetical component from a third-party library that needs to
// adapt to edge-to-edge mode.
function MyAwesomeLibraryComponent({
statusBarTranslucent = false, // Default to false if not provided
navigationBarTranslucent = false, // Default to false if not provided
}: MyLibraryComponentProps) {
// In development, warn library users if they are setting redundant translucency props
// when react-native-edge-to-edge is already managing system bars.
if (__DEV__) {
controlEdgeToEdgeValues({
statusBarTranslucent,
navigationBarTranslucent,
});
}
// Your internal native component or view might then consume these adjusted values.
// If edge-to-edge is active, we prioritize its setting, otherwise fall back to user-provided props.
return (
<View style={[
styles.container,
IS_EDGE_TO_EDGE_ACTIVE && styles.edgeToEdgePadding // Apply specific styling for edge-to-edge
]}>
<Text>
Edge-to-Edge is {IS_EDGE_TO_EDGE_ACTIVE ? 'ACTIVE' : 'INACTIVE'}
</Text>
<Text>
Status Bar Translucency: {IS_EDGE_TO_EDGE_ACTIVE || statusBarTranslucent ? 'True' : 'False'}
</Text>
<Text>
Navigation Bar Translucency: {IS_EDGE_TO_EDGE_ACTIVE || navigationBarTranslucent ? 'True' : 'False'}
</Text>
{/* Imagine a native component rendering here with adjusted props */}
{/* <MyAwesomeLibraryNativeComponent
statusBarTranslucent={IS_EDGE_TO_EDGE_ACTIVE || statusBarTranslucent}
navigationBarTranslucent={IS_EDGE_TO_EDGE_ACTIVE || navigationBarTranslucent}
// ... other props
/> */}
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#f0f0f0',
},
edgeToEdgePadding: {
// This is a placeholder for actual edge-to-edge safe area handling.
// In a real app, you'd use `react-native-safe-area-context` or similar.
paddingTop: 0,
paddingBottom: 0,
// Potentially more complex logic based on `react-native-edge-to-edge` hooks.
}
});
export default MyAwesomeLibraryComponent;
Errors
Common errors & fixes
Console warning: 'statusBarTranslucent' or 'navigationBarTranslucent' is defined but react-native-edge-to-edge is active.
A third-party library or an application component is explicitly setting system bar translucency properties while `react-native-edge-to-edge` is already managing these behaviors, potentially leading to redundant or conflicting configurations.
fixIf you are a library user, check your component props and remove explicit `statusBarTranslucent` or `navigationBarTranslucent` settings if `react-native-edge-to-edge` is intended to control them. If you are a library author, ensure your library correctly uses `controlEdgeToEdgeValues` to guide users, and adjust your own internal logic to respect `react-native-edge-to-edge`'s active state.
Edge-to-edge UI effects (e.g., transparent status/navigation bars) are not visible despite `isEdgeToEdge()` returning true.
While `react-native-is-edge-to-edge` may detect the *presence* of the main `react-native-edge-to-edge` package, the core library itself might not be correctly installed, linked, or configured in the native Android project (e.g., missing XML styles, `com.google.android.material:material` dependency issues).
fixThoroughly review the installation and configuration steps for the primary `react-native-edge-to-edge` package. Check Android manifest, `styles.xml`, and `build.gradle` for correct setup and ensure all native dependencies are satisfied, especially `com.google.android.material:material`.
Audit
Dependencies
reactrequiredPeer dependency for all React Native packages.
react-nativerequiredPeer dependency for all React Native packages.