MichaelCereda / react-native-form-generator

Generate forms with native look and feel in a breeze
MIT License
377 stars 105 forks source link

setValue issue #65

Open pawellewandowski opened 8 years ago

pawellewandowski commented 8 years ago

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)

MichaelCereda commented 8 years ago

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

Thanks for using my library

pawellewandowski commented 8 years ago

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

MichaelCereda commented 8 years ago

Ok but if you do that you will trigger also an onchange on the form at every iteration. You should assign the value using thevalue prop. Let me know if you have any problems. Thank you.

On Wed, Sep 21, 2016, 3:30 PM pawellewandowski notifications@github.com 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