Time: 10 minutes
- Set up a new React and TypeScript project
- Configure Git and GitHub Copilot
- Initialise the project repository
Initialise Project with Create React App
npm create vite@latest weather-app -- --template react-ts
Navigate to Project Directory
cd weather-app
Start the Development Server
npm run start
Install GitHub Copilot Extension in VSCode
- Go to Extensions (
Ctrl+Shift+X
orCmd+Shift+X
) - Search for "GitHub Copilot" and install it
- Go to Extensions (
Sign In to GitHub
- Follow the prompts to authenticate
Test GitHub Copilot
Open
src/App.tsx
Invoke the Inline Chat (
Ctrl+I
orCmd+I
)Prompt Copilot with a request like the following:
Create a functional component that displays "Hello, World!"
It should respond with a suggestion such as:
constHelloWorld=()=>{return<p>Hello, World!</p>;};
Accept the Suggestion
- Click
Accept
or use the hotkey (Ctrl+Enter
orCmd+Enter
) to accept Copilot's suggestion
- Click