我试图让自己熟悉 react.js 和 typescript。我试图声明一个 JSON 数组,但它给了我一个错误说......不可分配给 JSON
这是我的代码:
import React from 'react';
type MyProps = {
message?: string;
};
type MyState = {
chat_list : Array<JSON>
count: number; // like this
};
class ChatList extends React.Component<MyProps, MyState> {
state: MyState = {
count: 0,
chat_list : [
{
"name":"true",
"active" : true
}
]
};
...
我该如何解决这个问题?