Skip to content
This repository was archived by the owner on Oct 5, 2024. It is now read-only.
This repository was archived by the owner on Oct 5, 2024. It is now read-only.

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

@johanneskvamme

Description

@johanneskvamme

Describe the bug
When using a TextField, I get the warning:

Warning: A component is changing an uncontrolled input of type text 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

If I change to not controlling it with a value, the input is never displayed and the onChange triggers with only 1 letter at a time instead of concatinating the input every time.

Expected behavior
Either displaying input iteratively and always returning the entire state of the input field on onChange, or just let me control it without warnings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions