I am creating a storybook documentation of my custom App Components in 'react-native'
.
The problem is, the top left of navigator
is overlapping with the notification bar of android
.
Although I can fix the stories itself by margins and all but the navigator seems to have no fix.
I tried using SafeAreaView from react-native
but it doesn't seem to fix it.
I have seen some similar issues like this but they are for app code. Can anyone point out a fix for Storybook?
I am also attaching screenshot of the problem and the code where I am looking for a fix.
Code:
import * as Font from 'expo-font'
import AppLoading from 'expo-app-loading'
import React, { useState } from 'react';
import Storybook from './storybook'
import { registerRootComponent } from 'expo';
import { SafeAreaView ,StyleSheet} from 'react-native';
const fetchFonts=()=>{
return Font.loadAsync({
'open-sans-bold': require('./assets/fonts/OpenSans-Bold.ttf'),
'open-sans': require('./assets/fonts/OpenSans-Regular.ttf')
});
};
function App(props) {
const [dataLoaded,setDataLoaded] =useState(false);
console.log('Data is Loadinggg...',dataLoaded)
if(!dataLoaded){
return (
<AppLoading startAsync={fetchFonts} onFinish={()=> setDataLoaded(true)} onError={(err)=>{console.log(err)}}/> // donot proceed further until this is true -> render nothing
);
}
else{
return <SafeAreaView style= {styles.container} ><Storybook {...props}/></SafeAreaView>
}
}
export default registerRootComponent(App);
const styles = StyleSheet.create({
container: {
flex: 1,
}
});
In place of <SafeAreaView></SafeAreaView>
I am looking for a fix. Can someone help?