【发布时间】:2018-09-08 19:05:10
【问题描述】:
我有反应代码
export default class MyComponent extends Component<Props,State>
问题是,我是写像type 还是interface 这样的道具?
type Props = {
isActive: Boolean,
onClick: Function
}
或
interface Props {
isActive: Boolean,
onClick: Function
}
另外,当我不使用打字稿,而是使用经典的 webpack+babel 设置时,有什么区别?
或者,这对我来说很重要吗?
【问题讨论】:
标签: reactjs typescript flowtype