-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathApp.js
58 lines (53 loc) · 1.34 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// ## Namaste React Course by Akshay Saini
// # Chapter 02 - Igniting our App
/*
*** Parcel Feature ***
* Created A Server
* HMR - Hot Module Replacement
* File Watcher algorithm - C++ (Execute File when changes occur)
* BUNDLING
* MINIFY
* Cleaning our Code (Example - Remove Console.log)
* Dev and Production Build
* Super Fast build algorithm
* Image Optimization
* Caching while development
* Compression
* Compatible with older version of browser
* HTTPS on dev [Example - npx parcel index.html --https]
* Port Number [Example - If port number using in localhost then it will change in port number in another project running on localhost]
* Consistent Hashing Algorithm
* Zero Config
* Tree shaking
*
*
* Transitive Dependencies
*/
// imported react and reactdom from nodemodule folder
import React from 'react';
import ReactDOM from 'react-dom/client';
const heading = React.createElement(
"h1",
{
id: "title",
},
"heading"
);
const heading1 = React.createElement(
"h1",
{
id: "title",
},
"heading1"
);
const container = React.createElement(
"div",
{
id: "container",
},
[heading, heading1]
);
// create root using createRoot
const root = ReactDOM.createRoot(document.getElementById("root"));
// passing react element inside root
root.render(container);