react-native-form-generator icon indicating copy to clipboard operation
react-native-form-generator copied to clipboard

setValue issue

Open pawellewandowski opened this issue 8 years ago • 3 comments

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)

pawellewandowski avatar Sep 21 '16 17:09 pawellewandowski

Hello, Can you please post your code, sounds like a loop.

Thanks for using my library

MichaelCereda avatar Sep 21 '16 19:09 MichaelCereda

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]); } }

pawellewandowski avatar Sep 21 '16 19:09 pawellewandowski

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

MichaelCereda avatar Sep 22 '16 01:09 MichaelCereda