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
3535``` js | pure
3636import Form , { Field } from ' rc-field-form' ;
3737
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} / > ;
4939
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+ };
5258
5359export default Demo ;
5460```
You can’t perform that action at this time.
0 commit comments