Skip to content

Instantly share code, notes, and snippets.

@ms314006
Created January 29, 2023 06:17
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 ms314006/224a4a9915358f815d34fa8413559add to your computer and use it in GitHub Desktop.
Save ms314006/224a4a9915358f815d34fa8413559add to your computer and use it in GitHub Desktop.
import { useQuery } from 'react-query';
import apis from '../apis';
const useUser = () => useQuery(
['user'],
async () => {
const { data: user } = await apis.getUser();
return user;
}
);
export default useUser;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment