Any reason why you chose the name "isDisabled" instead of the already existing "disabled"? #6045
-
Considering that disabled is a property of many elements in React such as It's a bit of a long story, but the question arises because this caused a bug in my code. One component ended up accepting |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Consistency between all boolean props across all components is the reason. See our API naming guidelines for details. We decided a long time ago to name boolean props/variables with consistent prefixes for clarity. I would have expected TypeScript to have caught if you passed |
Beta Was this translation helpful? Give feedback.
Consistency between all boolean props across all components is the reason. See our API naming guidelines for details. We decided a long time ago to name boolean props/variables with consistent prefixes for clarity.
I would have expected TypeScript to have caught if you passed
disabled
instead ofisDisabled
. Was that not working for some reason?