import { useEffect } from 'react';
import axios from 'axios';
const SomeComponent = () => {
useEffect(() => {
axios.get('some great url to make an API call to')
.then((response) => {
console.log('The data we get back from the HTTP response:', response.data);
})
.catch((error) => {
console.log('Anything that isn't status code 2XX is an error:', error.response.status);
console.log('The data from response with an error:', error.response.data);
});
}, []);
return (<h1>My Perfect Component</h1>);
}