SHARE
TWEET

Untitled

a guest May 23rd, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. async componentDidMount() {
  2.     try {
  3.       const res = await fetch('http://127.0.0.1:8000/api/');
  4.       const todos = await res.json();
  5.       this.setState({
  6.         todos
  7.       });
  8.     } catch (e) {
  9.       console.log(e);
  10.     }
  11.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top