React报错之Cannot|React报错之Cannot assign to 'current' because it is a read-only property

正文从这开始~ 总览 当我们用一个null值初始化一个ref,但在其类型中不包括null时,就会发生"Cannot assign to 'current' because it is a read-only property"错误。为了解决该错误,请在ref的类型中包含null。比如说,const

    推荐阅读