react.dev
react.dev copied to clipboard
Add change vs input event description
The Synthetic Events docs for form events points to the Forms doc page as a reference for onChange, onInput, onInvalid, and onSubmit, but the Form page does not go into any detail about these events, and more importantly, how React's change
and input
events differ from the DOM events of the same name.
It appears a small note used to exist in the Form doc, but has been removed.
A short note about the change
event exists in the DOM Elements doc. This was not an obvious place to look to for this information to me, and it does not address the input
event. At the very least, this should probably be link to in the Synthetic Events doc, if no other changes are made.
I would like to see a more thorough description of the change
and input
events and when to use them in the Form doc.
I agree with the @samsch's suggestion that the documentation for form events in ReactJS could be more detailed, especially regarding the differences between React's change and input events and the corresponding DOM events.
To address this issue, I suggest adding a dedicated section to the Forms documentation that explains the nuances of these events and provides clear examples of when to use each one. Additionally, I think it would be helpful to include links to relevant sections of the DOM Elements documentation to provide further context and explanation.
Overall, I believe that improving the documentation in this way would greatly benefit ReactJS users and make it easier for them to understand and use these important form events.