1. ?? 空值合并运算符
const Value: string = inputRef.current?.value??"测试"
当inputRef.current存在就继续取value值,如果value值存在就返回value,不存在就返回"测试"给Value
2. 变量后使用 !:表示类型推断排除null、undefined
const inputValue: string = inputRef.current!.value.trim();
表示inputRef.current一定有值