Skip to content

Instantly share code, notes, and snippets.

@izabellewilding
Created July 9, 2020 20:57
Show Gist options
  • Save izabellewilding/f255cad9d8270629ec3017878d0d92be to your computer and use it in GitHub Desktop.
Save izabellewilding/f255cad9d8270629ec3017878d0d92be to your computer and use it in GitHub Desktop.
const [data, setData] = useState()
useEffect(() =>
fetch('https://example.api.com')
.then(response => response.json())
.then(data => this.setState({data});
), []);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment