Created
July 9, 2020 20:57
-
-
Save izabellewilding/f255cad9d8270629ec3017878d0d92be to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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