ui icon indicating copy to clipboard operation
ui copied to clipboard

TypeError: Cannot read property 'statusBarColor' of undefined

Open darmie opened this issue 6 years ago • 11 comments

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 screen shot 2018-11-20 at 7 05 03 pm

Version

@shoutem/ui": "^0.23.9"

darmie avatar Nov 20 '18 18:11 darmie

i have the same error

masterix21 avatar Nov 22 '18 09:11 masterix21

The same for me. Do you have a workaround for this issue?

agCepeda avatar Nov 25 '18 07:11 agCepeda

same issue

lnanhkhoa avatar Nov 26 '18 04:11 lnanhkhoa

https://github.com/shoutem/ui/issues/417#issuecomment-441519455

lnanhkhoa avatar Nov 26 '18 06:11 lnanhkhoa

+1

ozankonur avatar Nov 30 '18 05:11 ozankonur

I fixed it by downgrading to a previous version of @shoutem/ui

darmie avatar Nov 30 '18 07:11 darmie

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 avatar Nov 30 '18 07:11 ozankonur

@ozankonur Solution fixed the problem

ortegoncarlos avatar Dec 13 '18 15:12 ortegoncarlos

@ozankonur (Y)

sadi304 avatar Dec 21 '18 17:12 sadi304

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

prazeev avatar Dec 27 '18 08:12 prazeev

When a new release to fix error?

Eric013 avatar Jan 24 '19 11:01 Eric013