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

Warning: A component is changing an uncontrolled input of type undefined to be controlled. #54

Closed
Pong420 opened this issue Dec 4, 2019 · 2 comments

Comments

@Pong420
Copy link

Pong420 commented Dec 4, 2019

Warning: A component is changing an uncontrolled input of type undefined to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://fb.me/react-controlled-components
    in input (at src/index.tsx:8)
    in Input (at src/index.tsx:14)
    in Field (at src/index.tsx:13)
    in form (created by ForwardRef(Form))
    in ForwardRef(Form) (at src/index.tsx:12)
    in App (at src/index.tsx:21)

Step to reproduce

  1. Open CodeSandbox
  2. Expand Codesandbox's console
  3. Type on the input filed
@Pong420
Copy link
Author

Pong420 commented Dec 4, 2019

Solved by
Adding placeholder="" to Input component

Edit: Not solved

@Pong420
Copy link
Author

Pong420 commented Dec 5, 2019

Solved by adding initialValues={{username: ''}} to Form

@Pong420 Pong420 closed this as completed Dec 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant