Im using redux-form for my app, and everything looks great. But I dont like the way it handle with the inputs, or maybe Im doing a bad design.
I have this simple form on my app (as an example).
form onSubmit={handleSubmit} onChange={handleChange}>
<div>
<label htmlFor="firstName">First Name</label>
<Field name="firstName"
component="input" type="text"
ref='firstName'
withRef
/>
</div>
<div>
<label htmlFor="lastName">Last Name</label>
<Field name="lastName" component="input" type="text" />
</div>
<div>
<label htmlFor="email">Email</label>
<Field name="email" component="input" type="email" />
</div>
<FlatButton
label={intl.formatMessage({ id: 'submit' })}
type='submit'
primary
//disabled={!initialized}
/>
</form>
It looks good, but when I save it to firebase, it will save it as
email:blablabla@blabla
firstName:blablabla
lastName:bla
This is not what I want. I want something like a json with:
{userData: {
email:blablabla@blabla,
firstName:blablabla,
lastName:bla
}}
I have my own reason to want to do like this (dynamic forms).
Someone have a good idea on how to deal with this? I love redux-forms, and dont want to make aallllll the way with actions, reducers and this kind of stuff.
Thanks