this.handleClickRow = this.handleClickRow.bind(this)
I can pass it this way without redux
<BasicInformation
basicInformationData = { basicInformationData }
submitTaskId = { this.submitTaskId }
getTaskId = { _self.state.selectTaskId }
isAdmin = { _self.state.isAdmin }
/>
now I use redux to wrap the component, and I don"t know how to pass
.BasicInformationContainer.js
import React from "react";
import { connect } from "react-redux";
import BasicInformation from "../components/index";
import { toggleToChange } from "../../../../../actions";
import { DifferentLabelsFilters } from "../../../../../actions";
const getDifferent = (todos, filter) => {
let return_todos = "";
switch (filter) {
case DifferentLabelsFilters.SHOW_ALL:
return_todos = todos;
console.log("BasicInformationContainer return_to_dos = ", return_todos)
return return_todos;
case DifferentLabelsFilters.SHOW_COMPLETED:
return todos.filter(t => t.completed)
case DifferentLabelsFilters.SHOW_ACTIVE:
return todos.filter(t => !t.completed)
default:
throw new Error("Unknown filter: " + filter)
}
}
const showAdmin = (showAdmin) => {
return showAdmin;
}
const mapStateToProps = state => {
console.log("BasicInformationContainer state = ")
return {
showDifferent: getDifferent(state.showDifferent, state.differentLabelsFilter),
}
}
const mapDispatchToPropsReview = (dispatch) => {
const _self = this;
//console.log("BasicInformationContainer mapDispatchToPropsReview ===", _self.props)
//console.log("******************* dispatch ===", dispatch)
return {
toggleToChangeBasicInformation: id => dispatch(toggleToChange(id)),
toggleToSubmitTaskId: id => _self.props.submitTaskId(id),
}
};
export default connect(
mapStateToProps,
mapDispatchToPropsReview
)(BasicInformation);