You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Historically, defaultValue and value have been used for uncontrolled and controlled components (Link). This convention is useful because a consumer would like to set the value without actually controlling the component. In this case, they would use defaultValue to provide the initial value for the component without controlling it.
Our perspective
We would like to use default* as the standard prefix for setting the initial value of a prop. In particular, this comes up in controlled and uncontrolled components.
We would like to come up with consistent definitions for when to use
initial*
anddefault*
prefixed props in our codebase.Currently,
initial
is being used 4 times:initialSelectedItem
initialSelectedItems
initialChecked
initialPage
default*
is being used 6 times:defaultValue
defaultChecked
defaultExpanded
defaultToggled
defaultSelected
defaultOpen
Background
Historically,
defaultValue
andvalue
have been used for uncontrolled and controlled components (Link). This convention is useful because a consumer would like to set the value without actually controlling the component. In this case, they would usedefaultValue
to provide the initial value for the component without controlling it.Our perspective
We would like to use
default*
as the standard prefix for setting the initial value of a prop. In particular, this comes up in controlled and uncontrolled components.Links & Resources
The text was updated successfully, but these errors were encountered: