TypeScript Property 'props' does not exist
问题 I have this .tsx file import React, { Component } from 'react'; export class SidebarItem extends Component { constructor (props) { super(props); } render () { return (<li>{this.props.children}</li>); } } However, TypeScript throws this error: error TS2339: Property 'props' does not exist on type 'SidebarItem'. 回答1: The solution is to install the React Types defintions yarn add -DE @types/react More details from the typescript docs and from the types repo On a side note I had to restart vscode