在传入的数组映射后,无状态组件不呈现

时间:2017-09-05 20:01:27

标签: javascript reactjs

我重构了我的代码,现在有一个无状态组件从容器组件传递一个数组。然后我尝试映射传递到我的无状态组件的数组,但无法将其渲染。

正在正确传递数组,但是当我Sub Copy_Distribution() Dim OriginSheet As Worksheet Set OriginSheet = Sheets("Import Setup") Dim ObjectiveSheet As Worksheet Set ObjectiveSheet = Sheets("Import") Dim ColumnToPaste As Long Dim RowToGetValue As Long Dim GetColumn As Long ColumnToPaste = 15 'Because GetColumn For RowToGetValue = 3 To 98 'From 3 to 98 right? If OriginSheet.Cells(RowToGetValue, 12).Value > 0 Then For GetColumn = 1 To 4 ObjectiveSheet.Cells(2, ColumnToPaste + GetColumn).Value = OriginSheet.Cells(RowToGetValue, 11 + GetColumn).Value Next GetColumn ColumnToPaste = ColumnToPaste + 4 End If Next RowToGetValue End Sub 时,它只显示第一个console.log(msg)并且没有任何内容被渲染。

有人能发现下面的代码有什么问题吗?

msg

然后我有一个class App extends Component { componentDidMount() { const { getData } = this.props; getData(); } render() { const { messages } = this.props; return ( <ul> <MessageList messages={messages} /> </ul> ); } } const mapStateToProps = state => { return { messages: state.messages ? state.messages : [], members: state.members ? state.members : [] }; }; const mapDispatchToProps = dispatch => { return bindActionCreators({ getChatLog, getMembersData }, dispatch); }; export default connect(mapStateToProps, mapDispatchToProps)(App); 无状态组件,看起来像这样。

MessageList

0 个答案:

没有答案