react-native-safe-area-context
react-native-safe-area-context copied to clipboard
initialWindowSafeAreaInsets in v3 reports different bottom than initialWindowMetrics in v0.7 (Android)
I just updagraded from 0.7.3 to the latest v3.
I replaced initialWindowMetrics.bottom with initialWindowSafeAreaInsets.insets.bottom.
While this should be 0 (and was in v0.7.3), I am now getting 34 on the Nexus Android Simulator.
As far as I could see in the code, initialWindowSafeAreaInsets is declared to be:
export const initialWindowSafeAreaInsets = initialWindowMetrics?.insets;
And it should be the same, but I believe that this has to do with a certain delay to update the value correctly in initialWindowMetrics and then this value is not propagated to initialWindowSafeAreaInsets, making it not have the updated values.
Note: This is just a theory that can help in finding a solution to this problem. And for now exchanging initialWindowSafeAreaInsets for initialWindowMetrics solves the problem!
This is for v3 of the library, and we're on v4. Please re-open a new issue if you're still facing issues