Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Since v1, resetForm throws error #41

Closed
adrienharnay opened this issue Nov 29, 2017 · 7 comments
Closed

Since v1, resetForm throws error #41

adrienharnay opened this issue Nov 29, 2017 · 7 comments
Labels

Comments

@adrienharnay
Copy link

Hey,

Since upgrading to v1 (1.1.1 to be precise), I have this error when calling resetForm:

TypeError: Cannot read property 'inputs' of undefined
    at resetModel (webpack:////Users/adrien/Documents/GitHub/brigad-front-end/node_modules/formsy-react/lib/index.js?:221:12)
    at eval (webpack:///./client/src/common/user-details/js/DisplayCreateUserStates/components/CreateUserState.js?:95:9)
    at _callee2$ (webpack:///./client/src/action-creators/jobSeeker/states.js?:196:17)
    at tryCatch (webpack:////Users/adrien/Documents/GitHub/brigad-front-end/node_modules/regenerator-runtime/runtime.js?:65:40)
    at Generator.invoke [as _invoke] (webpack:////Users/adrien/Documents/GitHub/brigad-front-end/node_modules/regenerator-runtime/runtime.js?:299:22)
    at Generator.prototype.(anonymous function) [as next] (webpack:////Users/adrien/Documents/GitHub/brigad-front-end/node_modules/regenerator-runtime/runtime.js?:117:21)
    at step (webpack:///./client/src/action-creators/jobSeeker/states.js?:21:221)
    at _next (webpack:///./client/src/action-creators/jobSeeker/states.js?:21:409)
    at <anonymous>

Everything works as expected though. Maybe something was broken in the big update?

Thanks in advance!

@rkuykendall
Copy link
Member

Thanks for reporting this issue!

Looks like the issue here is a missing bind of resetModel in index.js. We had a similar issue in our Wrapper.js. The solution is definitely to remove all those binds and switch the file to use arrow functions.

@rkuykendall
Copy link
Member

If nobody else wants to tackle this, I should be able to make a PR this weekend.

@rkuykendall
Copy link
Member

Hey @Zephir77167, I haven't forgotten your issue, was just busy last weekend.

@adrienharnay
Copy link
Author

Hey, totally understandable, thanks for following up 👍

@rkuykendall
Copy link
Member

This should fix the issue. Giving it a little time for people to review. If you're able to test it that would be great, but that might be easier once it's on master.

https://github.com/formsy/formsy-react/pull/44/files

@rkuykendall
Copy link
Member

Hey @Zephir77167! formsy-react 1.1.2 is now published on NPM! Thank you for your patience. Let me know if this solved the bug you were encountering.

@adrienharnay
Copy link
Author

Thank you very much for the fix! The bug is fixed :)

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants