p
this
is unavailable in that method.. when you call this.changeContent
on line 60 change it to this.changeContent.bind(this)
. That will bind your component instance to the method.
you can also do this in a constructor if you want to by adding:
this.changeContent = this.changeContent.bind(this)
inside the constructor below super(props)
, then you can use the method as you have it
Can read more about bind
here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind