javascript - How to get the value of form in rect-form
PHPz
PHPz 2017-05-19 10:43:11
0
2
673

I am using react-redux. The onSubmit method that comes with react-form can directly obtain form data through parameters. How can I obtain it through other methods? ? ?

PHPz
PHPz

学习是最好的投资!

reply all(2)
某草草

Please analyze the code carefully.
onSubmit is called there. It is obvious here that account is passed by reference.
So, if you want to use it in other methods, you only need to pass it when calling.

phpcn_u1582

react-form provides the getFormValues ​​method, which can be called in mapDispatchToProps, so that the value of the form can be obtained, and then mapped to the props of the component, it can be passed as a parameter when calling. It’s a bit convoluted, but I haven’t found a better way yet

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template