Skip to content

Instantly share code, notes, and snippets.

@SuperOleg39
Created May 28, 2019 15:55
Show Gist options
  • Select an option

  • Save SuperOleg39/f58c1de85d1c21ea6770da8f4f32b94d to your computer and use it in GitHub Desktop.

Select an option

Save SuperOleg39/f58c1de85d1c21ea6770da8f4f32b94d to your computer and use it in GitHub Desktop.
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