Skip to content

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

@chungweileong94

Description

@chungweileong94

Describe the bug
I'm currently using Controller with MUI TextField, and it was amazing, but I keep getting this error: Warning: A component is changing an uncontrolled input of type text to be controlled., I have to set an empty string to as the default value to solve the problem, which I think it should done it by default.

To Reproduce
Steps to reproduce the behavior:

  1. Use Controller with MUI TextField
  2. Start typing something in the TextField

Codesandbox link
https://codesandbox.io/embed/react-hook-form-controlled-warning-demo-l7k6h?fontsize=14&hidenavigation=1&theme=dark

Expected behavior
No error/warning

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Microsoft Edge (Chromium)
  • Version 79.0.309.58

Additional context
A similar issue that i found from react-hook-form-input: react-hook-form/input#31

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions