Hello, I just started to create my app and learning how to do it ^^’
So my only code for the moment is the basic code you have when you create a blank project:
import { StatusBar } from 'expo-status-bar';
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
export default class App extends React.Component {
render(){
return (
<View style={styles.container}>
<Text>Open up App.js to start working on your app!</Text>
<StatusBar style="auto" />
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
When I display something on the top screen, what I display is under the status bar, so I was thinking that the best is to take the height of the status bar to display everything at the bottom of it but when I do
console.log(StatusBar.currentHeight)
the console say undefined.
So, can someone tell me what i do wrong please? ^^