React笔记[tsx]-解决Property ‘frames‘ does not exist on type ‘Readonly<{}>‘

浏览器报错如下:

React笔记[tsx]-解决Property ‘frames‘ does not exist on type ‘Readonly<{}>‘_第1张图片

编辑器是这样的:

React笔记[tsx]-解决Property ‘frames‘ does not exist on type ‘Readonly<{}>‘_第2张图片

原因是React.Component少了后面的any,改成这样即可:

export class CustomFrame extends React.Component{
    ......
    ......
}

你可能感兴趣的:(web前端,JavaScript,react.js,笔记,前端)