A form component have to take a value. This value is passed to the component by a prop. This prop can be called value or values, depending on wether the value is an array or a primitive.
For example :
<Component value="text" />
Or
<Component values={["text1, text2"]} />
I don't have any example where this difference was useful. Instead, I've got several examples where this was really disturbing. For example, when you code a form generator, you have to deal with the value type to return a component with value or with values ...
Have you example when this design choice was a good thing in your project ?
Can we drop out this and always use value ?
Of course, the change can be smooth, without breaking change (add the support of value in every component and deprecate after few versions the values prop).
En complément, l'attribut value pour un input en Typescript c'est string | number | readonly string[] donc celui-ci prend donc aussi un tableau.
Je dirais qu'il faut se baser sur les standards HTML
A form component have to take a value. This value is passed to the component by a prop. This prop can be called value or values, depending on wether the value is an array or a primitive.
For example :
I don't have any example where this difference was useful. Instead, I've got several examples where this was really disturbing. For example, when you code a form generator, you have to deal with the value type to return a component with value or with values ...
Have you example when this design choice was a good thing in your project ?
Can we drop out this and always use value ?
Of course, the change can be smooth, without breaking change (add the support of value in every component and deprecate after few versions the values prop).
What is your opinion about that ?