I
I
Icantdothis2022-02-27 20:47:19
React
Icantdothis, 2022-02-27 20:47:19

What is the reason for writing onChange to the input?

Why hang on the onChange input to change if the user already changes its value ?
There is a more detailed answer than in the documentation, where it says: is it necessary?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton, 2022-02-27
@Icantdothis

How does the state know that the value of the input has changed? The fact that the user has changed the text in the input is only visible to the user. Even in native JS, you attach an event handler to the input to track value changes.

B
budda674, 2022-02-28
@budda674

https://ru.react.js.org/docs/forms.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question