简体   繁体   中英

does ReactJS have something like React-Native's SafeAreaView?

I'm building a web-app using ReactJS and I also want it to be viweable onn mobile. Is there a component / workaround for handling iPhone's "safe area" view at the very top of the screen (eg dynamic island)? currently that safe area is just black, but i want it to have a set color

i tried including a and setting it to a background color

ReactJS relies on browser rendering engine (runs on top of the browser) while React Native has "native" performance as it interacts directly with android/ios native components (JavaScript threads). read here

Therefore ReactJS has no component to handle "safe area" display. Because it has been resolved by the browser. If you want to color the SafeAreaView (headerbar in the browser) you only need to add the following html code in tag.

<meta name="theme-color" content="#999999" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM