score:0

your gallery is an array & you're trying to access it like an object. try this render method instead:

  render() {
    .....
    if (this.state.buttonclicked) {
      this.state.galerie.length > 0 ? console.log('=>', this.state.gallery!.album.id) : ''; //it should work now
    }

 ......
  }

score:3

you define state but you don't specify it's type. typescript will thus infer the type of state based on the initialization. since galerie is an array but has no elements the best and safest type typescript can infer is never[]

the solution is to annotate the state member:

class app extends react.component {

  state:state  = {
    isloading: false,
    errormsg: '',
    buttonclicked: false,
    jsonfromserver: "",
    gallery:[] 
  }
  //...
}

Related Query

More Query from same tag