-
Notifications
You must be signed in to change notification settings - Fork 1k
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
FormField doesn't work with CustomComponent after updating to v2.11.3 #3898
Comments
Related: facebook/react#18178 |
Thanks for including the code sandbox, that helps to see what you are doing. I think the issue is that you don't have an
to be |
Thanks, @ericsoderberghp. Why should I have to pass an onChange my The reason why I am leaving
|
Who is The documentation for FormField |
This is likely a related issue: #3910, with React 16.13.1 both in scope. |
Considering that Grommets explicitly wants an |
But also when I do what you suggested I still get that warning in the console.
|
Any update on this issue? |
I think this issue is fixed on the latest release, can you please verify? |
Will do so today. Thanks for the update. |
The initial error reported doesn't seem to happen anymore, however, I get a new console error regarding changing an uncontrolled input of type text to be controlled. See sample component https://codesandbox.io/s/grommet-sandbox-g7564?file=/src/CustomFormField.js |
The warning in the above sandbox is due to: |
Thanks, @ericsoderberghp and @ShimiSun |
Expected Behavior
FormField should work with CustomComponent
Actual Behavior
After updating to v2.11.3, after typing one character in a custom text input, I can no longer type any other character. After spending some time debugging, I noticed that by adding the
value
property to theForm
component fixes it.This, however, introduces a warning.
Warning: Cannot update a component (`Form`) while rendering a different component (`TextInput`). To locate the bad setState() call inside `TextInput`, follow the stack trace as described in https://fb.me/setstate-in-render
URL, screen shot, or Codepen exhibiting the issue
You can try it out here https://codesandbox.io/s/grommet-sandbox-vso4c. Try removing the value from From and notices that you can no longer type in the CustomComponent
Steps to Reproduce
value
property is not set for the Formvalue
to the Form component and you will be able to typeYour Environment
The text was updated successfully, but these errors were encountered: