react/typescript: Parameter 'props' implicitly has an 'any' type error

前端 未结 4 807
心在旅途
心在旅途 2020-12-31 00:57

When I try this sample code from react-bootstrap, I keep getting errors such as \" Parameter \'context\' implicitly has an \'any\' type; \"Property \'value\' does not exist

4条回答
  •  被撕碎了的回忆
    2020-12-31 01:32

    Specifying the type of the constructor parameter resolved this issue in my case.

    class Clock extends React.Component {
    
        constructor(props: any) {
            super(props);
        }
    }
    

提交回复
热议问题