fix: initialize height and width to zero if undefined

closes #6789
This commit is contained in:
Satyajit Sahoo
2020-03-19 19:03:23 +01:00
parent 5c4afc5cb4
commit 3df65e2819
3 changed files with 30 additions and 20 deletions

View File

@@ -51,7 +51,12 @@ export default function BottomTabBar({
}: Props) {
const { colors } = useTheme();
const [dimensions, setDimensions] = React.useState(Dimensions.get('window'));
const [dimensions, setDimensions] = React.useState(() => {
const { height = 0, width = 0 } = Dimensions.get('window');
return { height, width };
});
const [layout, setLayout] = React.useState({
height: 0,
width: dimensions.width,