javascript - pass form data react redux fast -
right now, finding work process react , redux painfully slow, namely because of this:
//form changeinput(event){ this.props.changeinput(event.target.value) } render(){ <form <input onchange={this.changeinput} </form //actioncreator export function changeinput(value) return {type: 'change_input', value} //reducer switch(action.type) case: 'change_input' changeinput(state, action.value yadda yadaa yadaa. , exact same sequence of calls submitting form.
i cut out middle man. don't want have record input changes , pass changes state, because it's work.
because before redux, did this. form.serialize(); boom, have form data.
so, what's way react? should use jquery? no 1 seems use jquery react, can't think using jquery make things 100x easier.
i suggest trying redux-form.
it helped me reduce boilerplate.
it's pretty hackable , keeps redux practises.
and if you're reaching jquery you're missing something. go , read up, , ask questions this!
Comments
Post a Comment