Last active
October 24, 2019 18:24
-
-
Save mdshadman/7d0a3443b297a3b6a69a50b4bf97280f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
goForAxios = () => { | |
this.setState({ | |
fromFetch: false, | |
loading: true, | |
}) | |
axios.get("https://jsonplaceholder.typicode.com/users") | |
.then(response => { | |
console.log('getting data from axios', response.data); | |
setTimeout(() => { | |
this.setState({ | |
loading: false, | |
axiosData: response.data | |
}) | |
}, 2000) | |
}) | |
.catch(error => { | |
console.log(error); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment