Reactjs 警告:失败的propType:为“ListItem”提供的prop“children”无效,应为ReactNode

Reactjs 警告:失败的propType:为“ListItem”提供的prop“children”无效,应为ReactNode,reactjs,firebase,lodash,Reactjs,Firebase,Lodash,我和教程“聊天应用程序。使用React、Flux、Firebase和Webpack构建实时应用程序”一起构建了一个应用程序,我遇到了一个无法解决的问题。基本上,我试着把我在Firebase建立的频道拉到我在React的商店,但有些地方出了问题。下面是错误的代码部分: import alt from '../alt/index.js'; import Actions from '../actions/index.js'; import {decorate, bind, datasource} fr

我和教程“聊天应用程序。使用React、Flux、Firebase和Webpack构建实时应用程序”一起构建了一个应用程序,我遇到了一个无法解决的问题。基本上,我试着把我在Firebase建立的频道拉到我在React的商店,但有些地方出了问题。下面是错误的代码部分:

import alt from '../alt/index.js';
import Actions from '../actions/index.js';
import {decorate, bind, datasource} from 'alt-utils/lib/decorators';
import ChannelSource from '../sources/ChannelSource.jsx';
import _ from 'lodash';

@datasource(ChannelSource)
@decorate(alt)
class ChatStore {
constructor(){
 this.state = {user: null};
}

@bind(Actions.channelsReceived)
receivedChannels(channels){
let selectedChannel;
_(channels)
  .keys()
  .map((key, index) =>{
    channels[key].key = key;
    if (index == 0){
      channels[key].selected = true;
      selectedChannel = channels[key];
    }
  })
  .value();
console.log(channels);

this.setState({
  channels,
  selectedChannel
});
}
}

 export default alt.createStore(ChatStore);
在教程中使用了函数链:
keys().each().value()
来拉频道,但在我的应用程序中,它不起作用,所以我尝试使用.map()而不是.each(),但它也不起作用

浏览器显示仅与此部分代码相关的警告和错误:

import alt from '../alt/index.js';
import Actions from '../actions/index.js';
import {decorate, bind, datasource} from 'alt-utils/lib/decorators';
import ChannelSource from '../sources/ChannelSource.jsx';
import _ from 'lodash';

@datasource(ChannelSource)
@decorate(alt)
class ChatStore {
constructor(){
 this.state = {user: null};
}

@bind(Actions.channelsReceived)
receivedChannels(channels){
let selectedChannel;
_(channels)
  .keys()
  .map((key, index) =>{
    channels[key].key = key;
    if (index == 0){
      channels[key].selected = true;
      selectedChannel = channels[key];
    }
  })
  .value();
console.log(channels);

this.setState({
  channels,
  selectedChannel
});
}
}

 export default alt.createStore(ChatStore);
警告:失败的propType:提供给
ListItem
的prop
子项无效,应为ReactNode。检查
频道的渲染方法。
ListItem的“子项”只是从Firebase中提取的通道

以下是一个与此问题相关的错误: 未捕获(承诺中)错误:对象作为React子对象无效(找到:具有键{name,key,selected}的对象)。如果要呈现子对象集合,请改用数组,或使用React附加组件中的createFragment(object)包装对象。检查
ListItem
的渲染方法

我什么都试过了,但我把东西堆在这里,不能再往前走了。谢谢你的帮助