Skip to content

Warn when value and defaultValue are both specified #5819

Closed
@jimfb

Description

@jimfb

This should be illegal:

ReactDOM.render(
  <input value="foo" defaultValue="foo1" onChange={function(){}} />,
  document.getElementById('container')
);

Users need to decide if they are using controlled or uncontrolled inputs. We should warn if both properties are specified.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions