2
我有一个组件需要一个函数类型prop,有没有人试图浅化一个需要函数定义的组件?如何在酶中定义一个函数类型prop?
handleClick: React.PropTypes.func.isRequired
这是函数的定义
handleClick: function(){
this.props.handleClick(this.props.conversation)
}
这是我的测试
wrapper=shallow(<ConversationItem conversation={conversation1} active={true}/>);
怎么会在我的测试酶使用此功能道具???