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 };