File tree Expand file tree Collapse file tree 8 files changed +67
-151
lines changed
React_Learning/01_basics/src Expand file tree Collapse file tree 8 files changed +67
-151
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- import { useState } from 'react'
2
- import reactLogo from './assets/react.svg'
3
- import viteLogo from '/vite.svg'
4
- import './App.css'
5
-
1
+ import Header from './Header' ;
2
+ import Footer from './Footer' ;
3
+ import Food from './Food' ;
6
4
function App ( ) {
7
- const [ count , setCount ] = useState ( 0 )
8
-
9
- return (
10
- < >
11
- < div >
12
- < a href = "https://vitejs.dev" target = "_blank" >
13
- < img src = { viteLogo } className = "logo" alt = "Vite logo" />
14
- </ a >
15
- < a href = "https://react.dev" target = "_blank" >
16
- < img src = { reactLogo } className = "logo react" alt = "React logo" />
17
- </ a >
18
- </ div >
19
- < h1 > Vite + React</ h1 >
20
- < div className = "card" >
21
- < button onClick = { ( ) => setCount ( ( count ) => count + 1 ) } >
22
- count is { count }
23
- </ button >
24
- < p >
25
- Edit < code > src/App.jsx</ code > and save to test HMR
26
- </ p >
27
- </ div >
28
- < p className = "read-the-docs" >
29
- Click on the Vite and React logos to learn more
30
- </ p >
31
- </ >
32
- )
5
+ return (
6
+ < >
7
+ < Header />
8
+ < Food />
9
+ < Footer />
10
+ </ >
11
+ ) ;
33
12
}
34
13
35
- export default App
14
+ export default App ;
Original file line number Diff line number Diff line change
1
+ function Food ( ) {
2
+ const food1 = 'Orange' ;
3
+ const food2 = 'Banana' ;
4
+ return (
5
+ < >
6
+ < ul >
7
+ < li > Apple</ li >
8
+ < li > { food1 } </ li >
9
+ < li > { food2 . toUpperCase ( ) } </ li >
10
+ </ ul >
11
+ < hr />
12
+ </ >
13
+ ) ;
14
+ }
15
+ export default Food ;
Original file line number Diff line number Diff line change
1
+ function Footer ( ) {
2
+ return (
3
+ < footer >
4
+ < p > © { new Date ( ) . getFullYear ( ) } Your Website Name</ p >
5
+ </ footer >
6
+ ) ;
7
+ }
8
+ export default Footer ;
Original file line number Diff line number Diff line change
1
+ function Header ( ) {
2
+ return (
3
+ < header >
4
+ < h1 > My Website</ h1 >
5
+ < nav >
6
+ < ul >
7
+ < li >
8
+ < a href = "#" > Home</ a >
9
+ </ li >
10
+ < li >
11
+ < a href = "#" > About</ a >
12
+ </ li >
13
+ < li >
14
+ < a href = "#" > Services</ a >
15
+ </ li >
16
+ < li >
17
+ < a href = "#" > Contact</ a >
18
+ </ li >
19
+ </ ul >
20
+ </ nav >
21
+ < hr />
22
+ </ header >
23
+ ) ;
24
+ }
25
+
26
+ export default Header ;
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- import { StrictMode } from 'react'
2
- import { createRoot } from 'react-dom/client'
3
- import App from './App.jsx'
4
- import './index.css'
1
+ import { StrictMode } from 'react' ;
2
+ import { createRoot } from 'react-dom/client' ;
3
+ import App from './App.jsx' ;
5
4
6
5
createRoot ( document . getElementById ( 'root' ) ) . render (
7
- < StrictMode >
8
- < App />
9
- </ StrictMode > ,
10
- )
6
+ < StrictMode >
7
+ < App />
8
+ </ StrictMode >
9
+ ) ;
You can’t perform that action at this time.
0 commit comments