React - starts with basic

React - starts with basic

create react app without CRA command

I am writing this blog to help those people, who didn't follow 'npx create-react-app my-app '.

*Note: The basic requirement to start react: Node should be installed.

  1. Initialized a new project.

    Create a new folder in the local name <ReactAppName>. Open VsCode in the same folder. Open the terminal using the key ctrl+` and run the below command.

    npm init or npm init --y

  2. Install React, ReactDOM, React Scripts:

    Run the below command to install basic dependencies for react.

    npm install react react-dom react-scripts

  3. Create Folder Structure as per given:

  4. Write HTML code inside index.html

  5. Write React code inside index.js

  6. Write code inside App.js

  7. Write the start script inside package.json to run the react app.

  8. Now, open the terminal again and run the below command.

    npm start

Note: The application is running on port 3000. If you wish to change the port, create a '.env' file and add 'PORT=4001' to customize it.

That concludes the basic setup for React. Thank you for joining me on this journey, and I would love to hear any feedback or suggestions from your side.