I am trying to create a edit form using formsy-react. Is there a way to use an object to initialize the form input values in formsy-react instead of manually doing <Input value={this.state.someValue} />.
The code for my form is below.
<Formsy.Form className="horizontal" onValidSubmit={this._handleSubmit.bind(this)}>
<fieldset>
<legend>Product Details</legend>
<Input name="name" label="Name" type="text" required />
<Input name="sku" label="SKU" type="text" required />
</fieldset>
<fieldset>
<Row layout='horizontal'>
<input className="btn btn-primary" formNoValidate={true} type="submit" defaultValue="Submit" />
<button className="btn btn-default" onClick={this._handleCancel.bind(this)}>Cancel</button>
</Row>
</fieldset>
</Formsy.Form>
You can get a ref to the
Formsy.Formand call theresetfunction with an object that fills the form.