1、inputchange 写回调方法时候的type
要用
React.ChangeEvent<HTMLInputElement>
。2、
声明state时候用useState没有声明变量类型,当调用set时候就会报错
Type 'string' is not assignable to type 'never'.
需要在声明的时候
const [pictures, setPictures] = useState<string[]>([]);
3、类型转换
const address = JSON.parse(addressString) as AddressById_addressById;