score:6

Accepted answer
<input
  type="number"
  value={inputNumber}
  onChange={(val) => {
    //Some ways to do this
    setInputNumber(Number(val.target.value));
    setInputNumber(+val.target.value);
    setInputNumber(parseInt(val.target.value,0));
  }}
/>

score:1

const [email, setEmail]: [undefined, (value: ((prevState: undefined) => undefined) | undefined) => void] = useState();

score:1

const initialState: TYPE = {
  // ...
};
const [state, setState] = useState(initialState);

score:1

     const [email, setEmail] = useState<IUser>({email: ''})


Related Query

More Query from same tag