Answer the question
In order to leave comments, you need to log in
How to pass the necessary data from the redux store to the internal components?
Good afternoon! Tell me, please - how to correctly transfer only the necessary data to the internal components.
Learning from kanban boards. In the redux store - there is the following data
const initialState = [{
id: 1,
name: 'Project 1',
columns: [{
'id': 1,
'name': 'New'
},{
'id': 2,
'name': 'In Work'
},{
'id': 3,
'name': 'Done'
}]
},{
id: 2,
name: 'Project 2'
}]
const putStatesToProps = state => {
return {
projects: state.projects
}
}
export default connect(putStatesToProps)(ProjectsList);
const putStateToProps = state => {
let projectId = this.props.match.params.projectId;
return {
... тут выборка из общего стейта конкретного по id
}
}
export default connect(putStateToProps)(TasksColumnsList);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question