【问题标题】:Property 'startHeaderHeight' doesnot exist error属性“startHeaderHeight”不存在错误
【发布时间】:2019-02-08 02:55:19
【问题描述】:

我正在为我的 react 本机项目使用 Visual Studio Code。该项目运行良好。但是在这张图片中,为什么代码中有下划线。当我将鼠标悬停在它上面时,我得到了

"[ts] Property 'startHeaderHeight' does not exist on type 'Explore'.
any"

【问题讨论】:

    标签: reactjs typescript react-native visual-studio-code


    【解决方案1】:

    这是一个 TypeScript 错误,而不是一个 React 错误 Typescript 不维护 React TS 定义。

    refer here ans from gaearon

    【讨论】:

    • 是的,我已经尝试将它定义为构造函数,但我仍然得到红色下划线
    • 是的,它工作正常。我很好奇为什么这个红色下划线出现在 Visual Studio 代码中..
    • 我是你必须运行npm install @types/react@latest
    猜你喜欢
    • 2019-11-10
    • 1970-01-01
    • 1970-01-01
    • 2020-01-22
    • 1970-01-01
    • 2018-01-29
    • 1970-01-01
    • 2019-11-18
    • 1970-01-01
    相关资源
    最近更新 更多