3
下面的代碼示例是一個簡化版本的一個組件。我不明白這個組件底部的代碼,Case.wrappedComponent.propTypes部分。我無法在Internet上找到有關wrappedComponent的相關文檔。在reactjs中,什麼是wrappedComponent.propTypes?
問題:
- 什麼是它wrappedComponent和propTypes關鍵?
- 他們做什麼?
我在哪裏可以找到這些東西的文件?
import React, { Component } from 'react'; @inject('store') @observer export default class Case extends Component { constructor(props) { super(props); this.caseId = this.props.match.params.id; this.setOtherComment = this.setOtherComment.bind(this) this.submitOtherComment = this.submitOtherComment.bind(this) } render() { return '...' } } Case.wrappedComponent.propTypes = { store: React.PropTypes.object.isRequired, match: React.PropTypes.object.isRequired };