typescript报错:Object is possibly ‘null‘ 请问怎么解决?
这么写是不行的吗?请问应该怎么写呢?
`
readonly state = {
fold: true,
answer: null
};
render () {
return (
{ this.state.answer && this.state.answer.content }
) } `
最佳答案
readonly state: any = {
fold: true,
answer: null
};
..
原创
2020-12-05 13:06:30 ·
685 阅读 ·
0 评论