How to access a tag element

Asked

Viewed 52 times

0

I’m trying to pass my javascript code (Reactjs) the path image:

inserir a descrição da imagem aqui

And in the code I write like this:

source={{ uri: this.state.modelo.baner[0].url_img }} 

And the browser accuses this error:

Typeerror: Cannot read Property '0' of Undefined

  • 1

    Probably that this.state.modelo has not yet got the baner defenido... how does this this.state.modelo is being filled in/updated?

  • The image above is a part of the.log console of this This.

  • On the other tags I can use

  • 1

    What gives console.log(JSON.stringify(this.state.modelo));?

  • The best way I know to verify the existence of "props" and "States" after rendered, is with the extension React Developer Tools.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.