Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async componentDidMount() {
- try {
- const res = await fetch('http://127.0.0.1:8000/api/');
- const todos = await res.json();
- this.setState({
- todos
- });
- } catch (e) {
- console.log(e);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement