Skip to content

[Web] Nested <SafeAreaProvider> doesn’t update frame values #713

@Freddy03h

Description

@Freddy03h

Description

On the web, useSafeAreaFrame always returns the frame of the root <SafeAreaProvider>.
Nesting <SafeAreaProvider> components doesn’t seem to work.

Web : issue

Image

Native (iOS) : expected behavior

Image

Steps to reproduce

• Create a nested <SafeAreaProvider> that is smaller than the root one.
• Use useSafeAreaFrame to retrieve the values, but on the web it doesn’t return the frame of the nearest provider like it does on native.

(the snack example is on 5.6.0 but the issue is also on 5.7.0)

Snack or a link to a repository

https://snack.expo.dev/@freddy03h/safe-area-frame-issue

Safe Area Context version

5.7.0

React Native version

0.84.1

Platforms

Web

Architecture

None

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

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