如何修正打字本错误?
我从工作的git存储库克隆了应用程序,启动并接收了错误:
属性'language‘在类型' Readonly<{ }> &Readonly<{子>:ReactNode;}>上不存在。TS2339
<div className="login-block__form__head__text">
{// @ts-ignore
this.props.language === 'EN'// err
? 'Login'
: 'LOGIN'}{' '}
</div>不幸的是,我不知道打字稿,所以我不得不寻求帮助。

发布于 2020-06-01 17:59:07
在这种情况下,您没有定义道具类型。
interface PropType {
language: string,
}
export default class ComponentName extends React.Component<PropType> {
...
}如果您想了解更多有关打字本的内容,下面的链接将很有帮助。
https://stackoverflow.com/questions/62137715
复制相似问题