react-native-form-generator
react-native-form-generator copied to clipboard
setValue issue
Good evening,
I found some issue in form generator, when I used setValue method system on InputField application is blocked for 10 second(unblocked when value was set)
Hello, Can you please post your code, sounds like a loop.
Thanks for using my library
I use simple only loop:
for (var k in data) { if (data.hasOwnProperty(k) && this.refs.rightForm.refs[k]) { console.log(k); this.refs.rightForm.refs[k].setValue(data[k]); } }
Ok but if you do that you will trigger also an onchange on the form at every iteration. You should assign the value using the__value__ prop. Let me know if you have any problems. Thank you.
On Wed, Sep 21, 2016, 3:30 PM pawellewandowski [email protected] wrote:
I use simple only loop: for (var k in data) { if (data.hasOwnProperty(k) && this.refs.rightForm.refs[k]) { console.log(k); this.refs.rightForm.refs[k].setValue(data[k]); } }
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/MichaelCereda/react-native-form-generator/issues/65#issuecomment-248717658, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGjfheviDWEj1veA_h_ZPMQjGVdso1Wks5qsYXggaJpZM4KDGNS .
Michael Cereda http://michaelcereda.com