trying to read outside of a then/catch statment. It works fine inside .then but doesn't work inside of react html
class DashboardPage extends Component {
...
componentDidMount() {
axios.get('http://localhost:3000/users/me', this.yourConfig)
.then(function (response) {
// handle success
console.log(response.data.name)
console.log(response.data.email)
})
....
render() {
return (
<div className="App">
<p>Welcome {this.response.data.name}</p>
<p>Your email is {this.response.data.email}</p>
this is your token {this.tokenCookie}
</div>
);
}
}