react-native-safe-area-context icon indicating copy to clipboard operation
react-native-safe-area-context copied to clipboard

Big lighthouse score impact on web

Open natew opened this issue 3 years ago • 2 comments

Finally narrowed this down in my app - this package triggers reflows on mount on the web. I haven't taken the time to track it down yet but will revisit it soon, but figure it's worth tracking.

One test is to see if we can somehow set a css var we can read from:

https://benfrain.com/how-to-get-the-value-of-phone-notches-environment-variables-env-in-javascript-from-css/

Perhaps if set on root it won't trigger style calc.

natew avatar Jul 02 '22 09:07 natew

Yeah - something like calc(env(...) + someProp) would probably work better. See this file - https://github.com/th3rdwave/react-native-safe-area-context/blob/main/src/SafeAreaView.web.tsx#L55

jacobp100 avatar Jan 19 '23 11:01 jacobp100

Happy to take a look at PRs and give pointers

jacobp100 avatar Jan 19 '23 15:01 jacobp100