expo / react-native-appearance

Access operating system appearance information (currently only light/dark mode) on iOS, Android, and web
MIT License
337 stars 40 forks source link

fix(Web): Remove parent view with flex:1 #36

Closed darmawanalbert closed 4 years ago

darmawanalbert commented 4 years ago

Currently, NativeAppearanceProvider for web returns View with flex:1. When I add AppearanceProvider at my app root, the layout changes (the padding): Screen Shot 2020-02-04 at 19 01 25

However, if I clone props.children instead, the layout goes back to normal: Screen Shot 2020-02-04 at 19 02 39

Having said that, do you have any specific reason on why you return View with flex:1? Please kindly advise, as I am not sure if my proposed solution is legit 🙇

EvanBacon commented 4 years ago

I do it for parity with Android shim. CC @brentvatne

brentvatne commented 4 years ago

any idea why this causes the padding issues you observed?

darmawanalbert commented 4 years ago

@brentvatne still investigating the root cause. I will try to simulate this on empty project and will let you know if I find anything 🙇

darmawanalbert commented 4 years ago

I couldn't find a solid justification for this PR, therefore I will close this PR 🙇