File tree Expand file tree Collapse file tree 1 file changed +19
-13
lines changed Expand file tree Collapse file tree 1 file changed +19
-13
lines changed Original file line number Diff line number Diff line change @@ -35,20 +35,26 @@ open http://localhost:8000
35
35
``` js | pure
36
36
import Form , { Field } from ' rc-field-form' ;
37
37
38
- < Form
39
- onFinish= {values => {
40
- console .log (' Finish:' , values);
41
- }}
42
- >
43
- < Field name= " username" >
44
- < Input placeholder= " Username" / >
45
- < / Field>
46
- < Field name= " password" >
47
- < Input placeholder= " Password" / >
48
- < / Field>
38
+ const Input = ({ value = " " , ... props }) => < input value= {value} {... props} / > ;
49
39
50
- < button> Submit< / button>
51
- < / Form> ;
40
+ const Demo = () => {
41
+ return (
42
+ < Form
43
+ onFinish= {(values ) => {
44
+ console .log (" Finish:" , values);
45
+ }}
46
+ >
47
+ < Field name= " username" >
48
+ < Input placeholder= " Username" / >
49
+ < / Field>
50
+ < Field name= " password" >
51
+ < Input placeholder= " Password" / >
52
+ < / Field>
53
+
54
+ < button> Submit< / button>
55
+ < / Form>
56
+ );
57
+ };
52
58
53
59
export default Demo ;
54
60
```
You can’t perform that action at this time.
0 commit comments