Skip to content

Can't find variable SafeArea periodically #14

@pribeh

Description

@pribeh

Thanks for this superb lib. I think I might have something setup wrong or perhaps there's a bug but I'm receiving a "can't find ... variable" error periodically when loading the app in development mode.

Below is how I'm integrating safearea in my components/screens. Let me know if there's something wrong with it.

import { SafeArea } from 'react-native-safe-area';

class SomethingScreen extends React.Component {

async getSafeAreaInsets() {
        const safeAreaInsets = await SafeArea.getSafeAreaInsetsForRootView()

        topSafeArea = Platform.OS === 'ios' ? safeAreaInsets.top : 0
        bottomSafeArea = Platform.OS === 'ios' ? safeAreaInsets.bottom + 13 : 0
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions