Argument of type 'string | null' is not assignable to parameter of type 'string'.
前言
出现这个错误是在ts中使用 JSON.parse和localStorage.getItem出现的
const data = JSON.parse(localStorage.getItem(‘socialData’))

问题原因:
这是因为在使用localStorage.getItem(‘socialData’)的时候可能存在获取不到的情况或者返回null导致JSON.parse解析出现报错的情况
问题解决:
添加一个空的字符串json让他可以顺利编译
