Flicker caused by SafeAreaInsetsContext
See original GitHub issueScenes: When I use SafeAreaInsetsContext.Consumer to deal with safe screen issues. When my application enters the task management interface, it will flicker when it comes back。
reason: Can’t get the value of insets?.top in time
Source code:
<SafeAreaInsetsContext.Consumer> {insets => <View style={{ flex: 1, // Delayed acquisition paddingTop: insets?.top ?? 0, backgroundColor: '#fff', overflow: 'hidden' }}> // main content </View> } </SafeAreaInsetsContext.Consumer>
How to solve it? thanks
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5
I get a very noticeable flicker from using
SafeAreaView
withedges={['top']}
. Is this expected? I’m a bit confused. I have the provider at the root of my app too.I am also seeing this issue (in the context of supplying a custom header component to a screen in React Navigation v6). Strangely, despite it going against the performance recommendations in this project’s readme, I found the following comment helpful. Using
useSafeAreaInsets
and manually applying the padding to my custom header does not [so far] show the same flicker.