Created
May 28, 2019 15:55
-
-
Save SuperOleg39/f58c1de85d1c21ea6770da8f4f32b94d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fields = [{ | |
| type: 'input', | |
| placeholder: 'My field №1', | |
| value: '', | |
| onChange: (event) => {}, | |
| }, ...]; // 100 разных полей ввода | |
| const GenerateForm = (props) => ( | |
| <Form onSubmit={props.onSubmit}> | |
| {props.fields.map((field) => ( | |
| <input {...field} /> | |
| ))} | |
| </Form> | |
| ) | |
| <GenerateForm fields={fields} onSubmit={(event) => {}} /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment