How to create a react app without using create-react-app

Creating a React app without using create-react-app involves a few manual steps. Here’s a simplified guide to get you started:

Step 1: Set Up Your Project

  1. Create Project Folder: Create a new folder for your React project. You can name it whatever you like.bashCopy
mkdir my-react-app 
cd my-react-app
  1. Initialize Package.json: Run the following command to initialize a package.json file.bashCopy
npm init -y

Step 2: Install Dependencies

  1. React and ReactDOM: Install React and ReactDOM using npm.bashCopy
npm install react react-dom
  1. Babel: Install Babel packages for transpiling JSX and ES6
npm install @babel/core @babel/preset-env @babel/preset-react babel-loader --save-dev
  1. Webpack: Install Webpack for bundling your JavaScript files
npm install webpack webpack-cli webpack-dev-server --save-dev

Step 3: Create Project Files

  1. Create Source Files: Inside your project folder, create a src folder. Inside src, create an index.js file. This will be your main entry point.javascriptCopy code// src/index.js
// src/index.js
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';

ReactDOM.render(<App />, document.getElementById('root'));
  1. Create App Component: Create an App.js file inside the src folder.javascriptCopy code// src/App.js
// src/App.js
import React from 'react';

const App = () => {
  return (
      <h1>Hello, React!</h1>

export default App;

Step 4: Configure Babel and Webpack

  1. Create Babel Config: Create a .babelrc file in your project’s root folder.jsonCopy code//
// .babelrc
  "presets": ["@babel/preset-env", "@babel/preset-react"]
  1. Create Webpack Config: Create a webpack.config.js file in your project’s root folder.javascriptCopy code// webpack.config.js
// webpack.config.js
const path = require('path');

module.exports = {
  entry: './src/index.js',
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: 'bundle.js',
  module: {
    rules: [
        test: /\.js$/,
        exclude: /node_modules/,
        use: {
          loader: 'babel-loader',
  devServer: {
    contentBase: path.join(__dirname, 'dist'),
    compress: true,
    port: 3000,

Step 5: Create HTML File

Create an index.html file in your project’s root folder.

htmlCopy code

<!-- public/index.html -->
<!DOCTYPE html>
<html lang="en">
    <meta charset="utf-8" />
    <title>React App</title>
    <div id="root"></div>

Step 6: Run Your React App

  1. Build Your Project: Run the following command to bundle your JavaScript files using
npx webpack --mode development
  1. Start the Development Server: Run the following command to start the development server
npx webpack serve --mode development
  1. Your React app should now be running at http://localhost:3000.

That’s it! You’ve set up a basic React project manually without using create-react-app