laracasts / Vue-Forms

https://laracasts.com/series/learn-vue-2-step-by-step/episodes/19
396 stars 204 forks source link

Using Form.js and Error.js with react #22

Open ajsheldon93 opened 4 years ago

ajsheldon93 commented 4 years ago

Hey @JeffreyWay

I have utilized the Form and Error classes in Vue for a few years. They have been great assets to OOP my forms for ease of use and cleanliness of code. Thanks for building these simple classes.

I am doing a new project with React for the sake of trying to use and learn it. I am trying to use the same Form and Error classes. Most of it works except the error calls. When i add has() class in, it executes on load, but not once the errors are added when the form submits. I am doing this in the render function: {this.state.form.errors.has('first_name') && this.state.form.errors.get('first_name')}

Any idea what is happening? It seems to not recheck the function.

Thanks!