D
D
DeniSidorenko2020-11-10 10:31:19
React
DeniSidorenko, 2020-11-10 10:31:19

Why doesn't defaultValue change visually?

A strange situation, there is an input, for the output from the state Redux gave the defaultValue attribute. Through the inspector I see that the amount changes (when clicked), but visually the figure remains the same. If I put just value instead of defaultValue, then it works, but React swears

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
twolegs, 2020-11-10
@twolegs

I think you need to read this article here:
https://ru.reactjs.org/docs/uncontrolled-component...
You have two options for interacting with input - controlled and uncontrolled. Apparently now you are closer to the second.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question