Error accessing object item in React Native

0

I'm trying to access an object that is returned from my json / api.

When I get to the object the return is normal, but when I get to some object item the simulator displays an error.

My code that works, returning the complete object:

 render() {
    const boleto = this.props.boletodetalhe.data.unico;
    console.tron.log(boleto);
    return (
      <View style={styles.container}>

      </View>
    );
  }
}

On my console I have the following return.

IfIchangemycode,placinganitemofmyobjecttobedisplayedontheconsolewillgenerateanerror.

console.tron.log(boleto.nome);

Addingtheitemnameitgeneratesanerrorinmysimulator.

    
asked by anonymous 05.05.2018 / 23:09

0 answers