在类似下面的代码段的情况下,我应该如何处理状态类型为NaN
的{{1}}。
服务器发送对象数组:
number
因此,此处的空输入将产生interface MyInterface {id:number,amount:number,score:number}
// The received data is of type MyInterface[]
,NaN
值Warning: Received NaN for the
。
如果我检查情况
attribute. If this is expected,cast the value to a string.
应该更新什么状态?通常,在这种情况下,我怎么能有空的isnaN(parseInt(e.target.value))
?
input