{"size": 425, "ext": "js", "max_stars_repo_path": "graphql8207/src/components/GetCurrentUser.js", "max_stars_repo_name": "chrisbonifacio/amplify-issues", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "graphql8207/src/components/GetCurrentUser.js", "max_issues_repo_name": "chrisbonifacio/amplify-issues", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "graphql8207/src/components/GetCurrentUser.js", "max_forks_repo_name": "chrisbonifacio/amplify-issues", "max_forks_repo_forks_event_min_datetime": "2021-08-22T18:25:07.000Z", "max_forks_repo_forks_event_max_datetime": "2021-08-22T18:25:07.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 23.6111111111, "max_line_length": 70, "alphanum_fraction": 0.6588235294}
import React from 'react';
import {Auth} from 'aws-amplify';
import {Button} from 'react-native';

const GetCurrentUser = () => {
  async function getCurrentUser() {
    try {
      const user = await Auth.currentAuthenticatedUser();
      console.log({user});
    } catch (error) {
      console.log(error);
    }
  }
  return <Button title="Get Current User" onPress={getCurrentUser} />;
};

export default GetCurrentUser;
