Skip to content

Instantly share code, notes, and snippets.

Last active February 19, 2019 10:59
What would you like to do?
function useAxios(url) {
const [response, setResponse] = React.useState()
React.useEffect(() => {
.then(response => setResponse(response))
.catch(error => setResponse(error))
}, [url])
return response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment