这么写是不行的吗?请问应该怎么写呢?
`
readonly state = {
fold: true,
answer: null
};
render () {
return (
{ this.state.answer && this.state.answer.content }
) } `
readonly state: any = {
fold: true,
answer: null
};
如果未能解决,请移步:ts报错:Object is possibly ‘null‘ 详解
typescript报错:Object is possibly 'null' 请问怎么解决?
原文:https://www.cnblogs.com/8M0INF/p/14089173.html