TS React组件自定义属性的定义及使用

 

TaxesTable组件 定义的接口上没有type 属性,为什么呢?  其实我这里自己挖了个坑。我的TaxesTable里面是用Form.create去包裹了一层,Form.create()(Index)所以我们要给Form.create传一个泛型

TS React组件自定义属性的定义及使用

 

 这是我去查了Form.create是怎么定义接口的  意思是要先定义一个继承于FormComponentProps 的接口 

interface F extends FormComponentProps {
  type?:string
}

然后在Form.create<F>()(Index)

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-25
  • 2022-12-23
  • 2022-12-23
  • 2022-01-23
  • 2022-12-23
  • 2021-08-02
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案