ui
ui copied to clipboard
TypeError: Cannot read property 'statusBarColor' of undefined
I am trying to add a Navigation bar:
import React, { Component } from "react";
import { Text, View } from "react-native";
import styles from "./styles";
import { Button, Icon, NavigationBar, Title } from "@shoutem/ui"
export default class Dashboard extends Component {
render() {
return (
<NavigationBar
leftComponent={(<Button><Icon name="home" /></Button>)}
centerComponent={(<Title>Dashboard</Title>)}
rightComponent={(
<View>
<Button><Icon name="search" /></Button>
<Button><Icon name="settings" /></Button>
</View>
)}
/>
);
}
}
I am getting this error
Version
@shoutem/ui": "^0.23.9"
i have the same error
The same for me. Do you have a workaround for this issue?
same issue
https://github.com/shoutem/ui/issues/417#issuecomment-441519455
+1
I fixed it by downgrading to a previous version of @shoutem/ui
Solution: Change NavigationBar.js: import { Device } from "@shoutem/ui/helpers/device-selector.js";
and inside function setStyle (same file) replace the declaration of statusBarColor by: const { statusBarColor } = this.props ? this.props : { statusBarColor: bgColor };
@ozankonur Solution fixed the problem
@ozankonur (Y)
Solution: Change NavigationBar.js: import { Device } from "@shoutem/ui/helpers/device-selector.js";
and inside function setStyle (same file) replace the declaration of statusBarColor by: const { statusBarColor } = this.props ? this.props : { statusBarColor: bgColor };
This fixed my issue. Thanks
When a new release to fix error?