App Folders and Sample Addition program

 

App Folders

Node Module

*      Project node module and dependency presents in node module

*      If further need use npm command

Public Folder

*      Root folder   index.html

*      Index.html in div id and root is used for render purpose

Manifest.json

Project related Media files and meta files presents in Manifest.json

Src folder

Developer folder.All files webpage will access quickly.

Index.js

Javascript entry file.index.html root to div tag in const root.

<App/> render to work on flowly on index.js

Gitignore

file storage (compare old and new files)

Package-lock.json

File dependency.system version updation data present in this folder.

Readme.md

Project complete details presents in this file.

github project updation in Terminal

git  is a cloud storage

In cmd or vs code terminal

>git version

>git init

>git add

>git commit –m “First commit”

>git remote add origin URL

>git push –u origin main

>git config - - global user.email “email id”

>git config - - global user name

Sample addition Program

Change in index.js

 

import React from 'react';

import ReactDOM from 'react-dom/client';

import './index.css';

import App from './App';

import reportWebVitals from './reportWebVitals';

 

class Demo{

  methoddone(){

var a=5;

var b=10;

var c=a+b;

//document.getElementById('root').innerHTML=c;

 ReactDOM.createRoot(document.getElementById('root').innerHTML=c);

  }

}

var mydemo=new Demo();

mydemo.methoddone();

/*root.render(

  <React.StrictMode>

    <App />

  </React.StrictMode>

);*/

 

// If you want to start measuring performance in your app, pass a function

// to log results (for example: reportWebVitals(console.log))

// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals

reportWebVitals();

 

 

Output

 


 

No comments:

Post a Comment