react-native-paper
react-native-paper copied to clipboard
fix: Allow passthrough of safeAreaInsets on Appbar.Header
Motivation
If you use Appbar.Header
within a <SafeAreaView>
— there's no way to remove the top padding if you don't want it.
safeAreaInsets
is a valid prop for this component, but setting it does nothing.
<Appbar.Header
safeAreaInsets={{ top: 0 }}
>
This PR allows developers to have control over the insets of this component.
Test plan
This is a two line change, but as I'm not intimately familiar with this repo, I might be overlooking something.
To test, simply modify the safeAreaInsets on the Appbar.Header to modify the top padding.
Hey @chrysb, thank you for your pull request 🤗. The documentation from this branch can be viewed here.
Hey @gedu! Could you also please add this to the 5.12.4 milestone?
Hey, please link to the GH issue where this was discussed.
Why not using the statusBarHeight
prop?
<Appbar.Header
statusBarHeight={0}
>
or
<Appbar.Header
statusBarHeight={safeAreaInsets.top}
>
Or I'm missing something?