File tree Expand file tree Collapse file tree 4 files changed +47
-25
lines changed Expand file tree Collapse file tree 4 files changed +47
-25
lines changed Original file line number Diff line number Diff line change 66 "@testing-library/jest-dom" : " ^5.14.1" ,
77 "@testing-library/react" : " ^11.2.7" ,
88 "@testing-library/user-event" : " ^12.8.3" ,
9+ "bootstrap" : " ^5.0.1" ,
910 "react" : " ^17.0.2" ,
1011 "react-dom" : " ^17.0.2" ,
1112 "react-scripts" : " 4.0.3" ,
Original file line number Diff line number Diff line change 1- import logo from './logo.svg' ;
2- import './App.css' ;
1+ import { useState , React } from "react" ;
2+
3+ const App = ( ) => {
4+ const [ Text , setText ] = useState ( "" ) ;
5+ const [ FullName , setFullName ] = useState ( "" ) ;
6+
7+ const textEvent = ( fieldValue ) => {
8+ setText ( fieldValue . target . value ) ;
9+ } ;
10+
11+ const onSubmit = ( ) => {
12+ setFullName ( Text ) ;
13+ } ;
314
4- function App ( ) {
515 return (
6- < div className = "App" >
7- < header className = "App-header" >
8- < img src = { logo } className = "App-logo" alt = "logo" />
9- < p >
10- Edit < code > src/App.js</ code > and save to reload.
11- </ p >
12- < a
13- className = "App-link"
14- href = "https://reactjs.org"
15- target = "_blank"
16- rel = "noopener noreferrer"
16+ < >
17+ < div className = "container text-center pt-5" >
18+ < h1 > Hi, { FullName } </ h1 >
19+ < div className = "pt-3 pb-3" >
20+ < input
21+ type = "text"
22+ placeholder = "Enter your name"
23+ onChange = { textEvent }
24+ value = { Text }
25+ />
26+ </ div >
27+ < button
28+ type = "button"
29+ value = ""
30+ className = "btn btn-primary"
31+ onClick = { onSubmit }
1732 >
18- Learn React
19- </ a >
20- </ header >
21- </ div >
33+ Click Me
34+ </ button >
35+ </ div >
36+ </ >
2237 ) ;
23- }
38+ } ;
2439
2540export default App ;
Original file line number Diff line number Diff line change 1- import React from 'react' ;
2- import ReactDOM from 'react-dom' ;
3- import './index.css' ;
4- import App from './App' ;
5- import reportWebVitals from './reportWebVitals' ;
1+ import React from "react" ;
2+ import ReactDOM from "react-dom" ;
3+ import "./index.css" ;
4+ import App from "./App" ;
5+ import reportWebVitals from "./reportWebVitals" ;
6+ import "bootstrap/dist/css/bootstrap.min.css" ;
67
78ReactDOM . render (
89 < React . StrictMode >
910 < App />
1011 </ React . StrictMode > ,
11- document . getElementById ( ' root' )
12+ document . getElementById ( " root" )
1213) ;
1314
1415// If you want to start measuring performance in your app, pass a function
You can’t perform that action at this time.
0 commit comments