将流星数据传递给动态反应儿童

时间:2016-03-18 02:51:16

标签: reactjs meteor-react

我正在使用Meteor和React。我也在使用getMeteorData()(是的,我知道mixins可能有一天死了)。加载它的组件中的数据很好,但是我想将它(或其子集)与其他道具一起传递给动态子项,如下所示:

content = Children.map(this.props.children, child => {
  console.log('Test: ', this.data.testData) //<- this logs the expected data
  let test = this.data.testData 
  return cloneElement(child, {
    ...child.props, //<- THIS IS OK
    ...this.props, //<- THIS IS OK
    data: this.data, //<-- THIS DOES NOT SHOW UP IN THE CHILD
    testData: {test} //<-- THIS DOES NOT SHOW UP IN THE CHILD
  })
})

我缺少什么和/或如何将流星数据与其他道具一起传递给动态儿童?

TIA

0 个答案:

没有答案