📌  相关文章
📜  类型“null”不可分配给类型“ImageSourcePropType”. - 打字稿代码示例

📅  最后修改于: 2022-03-11 14:48:12.941000             🧑  作者: Mango

代码示例1
// You can now use the non-null assertion operator that is here exactly 
// for your use case.
// It tells TypeScript that even though something looks like it could 
// be null, it can trust you that it's not:
let name1:string = person.name!; 
//                            ^ note the exclamation mark here