Skip to content

Instantly share code, notes, and snippets.

@harshaktg
Created June 2, 2021 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harshaktg/662f8151b0977ffcaff71bc33bca5572 to your computer and use it in GitHub Desktop.
Save harshaktg/662f8151b0977ffcaff71bc33bca5572 to your computer and use it in GitHub Desktop.
useAxios - Step 3
import useAxios from './useAxios';
const App = () => {
const { response, error, loading } = useAxios();
return (
<div className="app">
{loading ? (
<div>Loading...</div>
) : (
<div>
{error && error.message}
{response && response?.map((item) => <div>{item.title}</div>)}
</div>
)}
</div>
);
};
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment