I make a call to my server, which is expecting an object back from this call.
constructor(props) {
super(props);
this.state ={todos: []};
}
componentDidMount() {
console.log("HELLO");
axios.get("http://localhost:4000/todos")
.then(response =>{
console.log(response.data); // this works
this.setState({todos: response.data});
})
console.log(this.state.todos); // this does not (why?)
}