【发布时间】:2017-08-09 02:08:53
【问题描述】:
例如,我们有一个容器<ContainerName data=someData> 并传递一些道具数据。
在这个容器中,我们使用 recompose 并有以下代码:
const enhance = compose(
withProps({
statuses: ['ordered', 'received'],
}),
withProps(
// how do I pass props from this container to component ?
),
withState('error', 'setError', false),
withState('successAdded', 'setSuccessAdded', false),
withState('loading', 'setLoading', false),
withState('confirmModal', 'setConfirmModal', false),
...
export default enhance(ComponentForm);
我们如何将属于这个容器的 props 传递给我们的组件?
【问题讨论】: