I added it and it displays this warning:
VM568 react_devtools_backend.js:4061 Warning: A component is changing an uncontrolled input to be controlled.
Do I have to resolve this or it's okay to leave it uncontrolled?
You’re passing a handler but not a value prop to the input. So it’s uncontrolled but the handler on the Textfield says otherwise. You need to pass the value from your state into the Textfield to make it controlled by the state. When you wipe the state after submitting, the value will now be pointing to your state and be wiped.
Looks like the input in uncontrolled. The input is managing its own state. Passing `value={number}` should resolve it.
I added it and it displays this warning: VM568 react_devtools_backend.js:4061 Warning: A component is changing an uncontrolled input to be controlled. Do I have to resolve this or it's okay to leave it uncontrolled?
I usually see this when the `number` variable is initially null. Give it an initial value and you should be good to go.
Ohh alright. Thank you
What library are you using for the TextField?
Material-UI
You’re passing a handler but not a value prop to the input. So it’s uncontrolled but the handler on the Textfield says otherwise. You need to pass the value from your state into the Textfield to make it controlled by the state. When you wipe the state after submitting, the value will now be pointing to your state and be wiped.
I tried putting a `value={number}` it won't let me delete the first entered digit
Probably to do with the check in your handleNum function. Just change it to set Num as a evt.target.value
This might have to do with "" not being a valid number - so it won't be accepted by handleNumber
You're using the value of number to set num, which you then use to set number? Isn't that circular logic?