我想在父函数中定义的子函数中使用this.props.childName。但如果我使用this.props.parentName,就会出现TypeScript编译错误(Property 'name' does not exist...),这没问题。如何访问子类的this.props?interface Prop<T> {}
class Parent<T> extends React.Component<Prop<T>
我有一个扩展React.Component类的类,并且我正在为它传递我自己的接口,用于我期望接收的道具。问题是,当我使用SomeComponent.propTypes = {...时,webstorm linter会说有些地方不对劲,说Property 'propTypes' does not existSomeComponent的代码是
class SomeComponent extends React.Component<IProps, {}> {...}在这种情况下,