File tree Expand file tree Collapse file tree 4 files changed +392
-357
lines changed
subjects/06-Controlled-vs-Uncontrolled Expand file tree Collapse file tree 4 files changed +392
-357
lines changed Original file line number Diff line number Diff line change @@ -19,52 +19,50 @@ import React from "react";
1919import ReactDOM from "react-dom" ;
2020import serializeForm from "form-serialize" ;
2121
22- class CheckoutForm extends React . Component {
23- render ( ) {
24- return (
25- < div >
26- < h1 > Checkout</ h1 >
27- < form >
28- < fieldset >
29- < legend > Billing Address</ legend >
30- < p >
31- < label >
32- Billing Name: < input type = "text" />
33- </ label >
34- </ p >
35- < p >
36- < label >
37- Billing State: < input type = "text" size = "2" />
38- </ label >
39- </ p >
40- </ fieldset >
22+ function CheckoutForm ( ) {
23+ return (
24+ < div >
25+ < h1 > Checkout</ h1 >
26+ < form >
27+ < fieldset >
28+ < legend > Billing Address</ legend >
29+ < p >
30+ < label >
31+ Billing Name: < input type = "text" />
32+ </ label >
33+ </ p >
34+ < p >
35+ < label >
36+ Billing State: < input type = "text" size = "2" />
37+ </ label >
38+ </ p >
39+ </ fieldset >
4140
42- < br />
41+ < br />
4342
44- < fieldset >
43+ < fieldset >
44+ < label >
45+ < input type = "checkbox" /> Same as billing
46+ </ label >
47+ < legend > Shipping Address</ legend >
48+ < p >
4549 < label >
46- < input type = "checkbox " /> Same as billing
50+ Shipping Name: < input type = "text " />
4751 </ label >
48- < legend > Shipping Address</ legend >
49- < p >
50- < label >
51- Shipping Name: < input type = "text" />
52- </ label >
53- </ p >
54- < p >
55- < label >
56- Shipping State: < input type = "text" size = "2" />
57- </ label >
58- </ p >
59- </ fieldset >
60-
52+ </ p >
6153 < p >
62- < button > Submit</ button >
54+ < label >
55+ Shipping State: < input type = "text" size = "2" />
56+ </ label >
6357 </ p >
64- </ form >
65- </ div >
66- ) ;
67- }
58+ </ fieldset >
59+
60+ < p >
61+ < button > Submit</ button >
62+ </ p >
63+ </ form >
64+ </ div >
65+ ) ;
6866}
6967
7068ReactDOM . render ( < CheckoutForm /> , document . getElementById ( "app" ) ) ;
You can’t perform that action at this time.
0 commit comments