Skip to content

Fabric SafeAreaView self-provider fallback misses UIKit inset changes #781

Closed

Description

@kes-agent

Description

Fabric's RNCSafeAreaViewComponentView falls back to _providerView = self when it cannot find a provider, but it does not override safeAreaInsetsDidChange. Provider notifications cannot update that fallback, so UIKit inset changes after mounting are not applied. The fallback path exists in both 5.9.1 and current main.

Our local workaround overrides safeAreaInsetsDidChange, calls super, and calls updateStateIfNecessary only when _providerView == self.

Steps to reproduce

  1. Build this component on iOS with Fabric and safe-area-context 5.9.1:
import { useState } from 'react';
import { Button, Modal, Text } from 'react-native';
import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context';
export default function App() {
  const [open, setOpen] = useState(false);
  return <SafeAreaProvider>
    <Button title="Open" onPress={() => setOpen(true)} />
    <Modal visible={open} presentationStyle="pageSheet">
      <SafeAreaView style={{ flex: 1 }}>
        <Text>Inspect the safe-area padding after rotating or resizing the sheet.</Text>
        <Button title="Close" onPress={() => setOpen(false)} />
      </SafeAreaView>
    </Modal>
  </SafeAreaProvider>;
}
  1. Open the native modal and rotate or resize it so its safe-area insets change.
  2. Set a breakpoint in updateStateIfNecessary: the self-provider fallback lacks a callback for these UIKit changes.

This snippet is an extracted reproduction recipe, not a new simulator run. The report is based on inspecting the fallback implementation and our integration patch. Adding a SafeAreaProvider inside the Modal is the documented workaround; this report asks whether the existing self-provider fallback should also keep updating, or whether it is intentionally unsupported.

Snack or a link to a repository

Source of the fallback: https://github.com/AppAndFlow/react-native-safe-area-context/blob/main/ios/Fabric/RNCSafeAreaViewComponentView.mm

Safe Area Context version

5.9.1

React Native version

0.88.0-rc.3

Platforms / Architecture

iOS / Fabric. Reproduction build/device: not rerun for this report.

Acknowledgements

Searched existing modal, Fabric, and missing-provider issues; none described this specific missing UIKit callback in the self-provider fallback.

Activity

  1. hirbod commented on Nov 2, 2026

    @hirbod
    Contributor

    I ran into this with a react-native-screens formSheet. After a rotation the insets stay stale until the next React commit. There's a repro at https://github.com/hirbod/rnsac-rotation-repro and #803 fixes it with the safeAreaInsetsDidChange override you suggested.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions