也不知道对不对,反正数据出来了,心情激动啊,在这个问题上绕了好几天了,
问题描述:
const mapStateToProps = state => ({
在这里console.log可以看到state里有数据,但是props里始终是空的。
items: state.videoReducer.items
});
export default connect(mapStateToProps, {fetchVideos})(Home)
解决方法:
const items = this.props.items.length > 0 ? <ContentList items={this.props.items}/> : '加载中……'
没想到最后加了一句判断就好了。