-
Notifications
You must be signed in to change notification settings - Fork 50.4k
Closed
Labels
Description
Type
inconsistency for common use cases.
bug for projects relying on correct DOM emissions.
Description
It's unclear to me if the following is a known issue or not.
Take in consideration the snippet below:
<input type="checkbox" defaultChecked={true} />Current Behavior
Setting the defaultValue prop on inputs of other types sets both the value and defaultValue attribute on the DOM element.
When setting the defaultChecked prop on inputs of type checkbox only the checked attribute is correctly set, leaving the defaultChecked attribute unchanged.
Expected Behaviour
Like mentioned above, the expected behavior would be for the defaultChecked prop to set both the checked and defaultChecked attributes on the corresponding DOM node (like it's the case with the defaultValue prop).