The goal is to use GitHub Copilot to help us create a page that will show the GitHub profile of a user.
Open a terminal in the IDE and run the project
npm start
You changes will be automatically reloaded in the browser.
For this lets start by the creation of some components that will be used in the page:
- Create a
Main
component that will be the main page of the application. - Create a
Header
component that will be used to show the header of the page. - Create a
User
component that will be used to show the user profile.
Use the chat to create the new files and add the code to the files.
Possible Flow
- Open Copilot Chat
- Ask the following question:
@workspace create a new component called Main that is called from the App.js Create a Header component that will show the name of the application Create a User component that will show the user profile using a call to the GitHub API using fetch Add Header and user to the Main component
Use Copilot to learn and implement how call the GitHub API to get the user profile with a given username.
Something like: http://localhost:3000?name=tgrall
Possible Flow
- Open the
User.js
file, select the code - Ask Copilot Inline Chat to add a parameter to the component, using for example this question:
use the browser url paramter name=tgrall to pass the value to the github api call