1
レンダリング時にネストされたエンティティデータを自動的に挿入する方法はありますか?レンダリング時にエンティティデータを自動的に注入
const mapStateToProps = (state, ownProps) => {
let boardId = ownProps.params.id
return {
id: boardId,
// is there an easier method to do this?
comments: state.entities.boards[boardId].comments.map(id => {
return Object.assign({}, state.entities.comments[id], {
user: state.entities.users[state.entities.comments[id].user]
})
})
}
}