将react应用程序更新为typescript 15.6之后,所有内容都会中断,因为它无法在React.Component上找到props和setState。
我一直在谷歌上搜索,但找不到任何打字的具体信息,可以转移到15.6。
mod <- train(Species ~ ., data = iris, method = "lda", preProc = list(ignore = "Sepal.Width"))
import * as React from "react";
import * as ReactDOM from "react-dom";
import { connect } from 'react-redux';
@connect(state => ({auth: state.auth}))
class App extends React.Component<{auth?: any}, any> {
render() {
if (this.props.auth.user == null) return <div><LoginModal /></div>;
return <div>...stuff here...</div>
}
}
以下是该项目的依赖项。
ERROR in [at-loader] ./components/pages/tags/tag-item.tsx:74:78
TS2339: Property 'props' does not exist on type 'TagItem'.
ERROR in [at-loader] ./components/pages/tags/tag-item.tsx:76:14
TS2339: Property 'setState' does not exist on type 'TagItem'.