Lesson 5 - Set up Dev Environment
Last updated
Last updated
download Visual Studio Code for your platform (Windows, Mac, Linux) and install
start VS Code
Press Ctrl+Alt+I or select Use AI Features with GitHub Copilot for Free... from the Copilot menu in the title bar
Select Sign in to Use Copilot for Free to sign in to your GitHub account and sign up for Copilot Free
Install VSC extensions :
Prettier - Code formatter
Theme oh lucy
ES7+ React/Redux/React-Native snip
Download the package and install latest Node.js
Update nodeJS Using the Node.js Installer (Windows and macOS)
use below npm command to upgrade npm to latest
How To Install Git Bash On Windows
Go to the website: Navigate to the official Git for Windows website (git-scm.com).
Download the installer: Click "Download" to get the latest version of the Git installer for Windows.
Run the installer: Open the downloaded executable file (Git-2.47.1.2-64-bit.exe).
Follow the prompts:
Accept the license agreement.
Choose the default installation directory.
Important: During the installation options, make sure to select "Add Git Bash to the PATH" or a similar option to access Git Bash from your command prompt, ensuring to select the "Git Bash" option during the installation process.
Finish installation: Click "Install" and then "Finish" to complete the process.
Two options for sign up ::
Continue with GitHub account or
Use your email account and check your email for confirmation.
After finishing sign up, now you can sign in with your credentials
Enter your email address for Sign Up for free. Check your email for confirmation.
After finishing sign up, now you can sign in with your credentials either by Sign In with Google or email.
Use your email to create GitHub free account
Email:
Password:
Username:Aklebek
Verify your account with visual or audio puzzle
Confirm your email address and enter code. You are all set and good to go.
check whether you already installed a right version of node.js
Open Bash/PowerShell terminal and create your working directory, ie. "react-sandbox". Change the directory to "react-sandbox" and install vite latest version.
Then follow the prompts!
Project name:react-fun-facts-yourname
Select a framework: > React
Select a variant: > JavaScript
Change the directory to "react-fun-facts-yourname". And then install and run.
Install any necessary dependencies (optional): While this basic app doesn't require additional libraries, you can install styling libraries like Bootstrap if needed:
Click : http://localhost:5173
Try our codebase example - static react app
export default
and export
with Named Exports in JavaScriptIn JavaScript modules, export
statements are used to make functions, objects, or primitive values available to other modules. There are two main ways to export: export default
and named exports. Here's a breakdown of their differences:
When creating JavaScript modules, there are two common ways to export code from a file: using export default
and using export
with named exports.
export default
(Default Export)One per module: You can have only one default export per module.
Import with any name: When importing a default export, you can use any name you want.
Common use case: Typically used for exporting the primary or main functionality of a module.
Syntax:
Exporting:
JavaScript(JSX)
Importing:
JavaScript(JSX)
Example:
JavaScript(JSX)
Multiple per module: You can have multiple named exports in a single module.
Import with the same name (or alias): When importing named exports, you must use the same name as the export, or use an alias with the as
keyword.
Common use case: Used for exporting multiple functions, objects, or values that are related but not necessarily the primary functionality.
Syntax:
Exporting:
JavaScript(JSX)
Importing:
JavaScript(JSX)
Example:
JavaScript(JSX)
Feature
export default
Named Exports
Number per module
One
Multiple
Import name
Any name
Same name (or alias)
Syntax (import)
import anyName from 'module';
import { name1, name2 } from 'module';
Use Case
Main functionality of a module
Multiple related functions, objects, or values
Which to Use?
Use export default
when you have a single primary export from a module, like a class or a function that represents the main purpose of the module.
Use named exports when you have multiple related exports from a module. This improves code clarity and allows for more granular imports.
By understanding these differences, you can effectively structure your JavaScript modules and improve code organization.
To install Git Bash on Windows, go to the official Git for Windows website (), download the latest version, run the executable file, and follow the on-screen instructions, ensuring to select the "Git Bash" option during the installation process; essentially, you're installing the full Git package which includes Git Bash as a component.
Visit site to generate a temporary email for test.
Go to site.
Go to site
Go to site
go to vite.dev site and click get started ().
Vite requires version 18+ or 20+.