@TkDodo@therealtaochu More context:
If I don’t separate the input into a separate component, on every render it sets the value of the input to the state value, even if state hasn’t changed. If I use defaultValue, the value of the number input won’t change when I change the range input.
@TkDodo@therealtaochu What about in the case of a controlled input?
I have a range input and a number input both controlling the same state. I only want the number input to update the state when the target value is valid.
Am I doing smth wrong here? How do I fix this?
Today, we’re thrilled to launch https://t.co/rxBDrIgPJi, the new home for React and its documentation. It teaches modern React with function components and Hooks, and we’ve included diagrams, illustrations, challenges, and over 600 interactive examples. Check it out!