SafeAreaView/index.js

react-native-web · packages/react-native-web/src/exports/SafeAreaView/index.js · javascript · MIT
ui, UI / Frontend

React component wrapping View to apply safe‑area insets for web and mobile platforms.

// Source: https://github.com/necolas/react-native-web | License: MIT | Copyright Nicolas Gallagher
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * Copyright (c) Nicolas Gallagher.
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @flow
 */

import type { ViewProps } from '../View';

import * as React from 'react';
import StyleSheet from '../StyleSheet';
import View from '../View';

type SafeAreaViewProps = {
  ...ViewProps,
  ref?: React.Ref<React.ElementRef<typeof View>>
};

const SafeAreaView = (props: SafeAreaViewProps): React.Node => {
  const { ref, style, ...rest } = props;
  return <View {...rest} ref={ref} style={[styles

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key