А какое это имеет значение?
renderProfileData = testingReducer => {
const {
q_age,
q_lang,
q_metric,
q_height,
q_weight,
q_sex
} = testingReducer;
return (
<React.Fragment>
<div className="testing-profile-data">
<span>Language of questions</span>
<span>{q_lang.value === 1 ? "English" : "Swedish"}</span>
</div>
<div className="testing-profile-data">
<span>Measurements</span>
<span>{q_metric.value === 1 ? "Metric" : "U.S. units"}</span>
</div>
<div className="testing-profile-data">
<span>Sex</span>
<span>{q_sex.value === 1 ? "Male" : "Female"}</span>
</div>
<div className="testing-profile-data">
<span>Age</span>
<span>{q_age.value}</span>
</div>
<div className="testing-profile-data">
<span>Weight</span>
<span>{q_weight.value}</span>
</div>
<div className="testing-profile-data">
<span>Height</span>
<span>{q_height.value}</span>
</div>
</React.Fragment>
);
};
{data.q_lang === 1 ? 'English' : 'Swedish'}
changeContent = (action) => {
const {productTable, routeParams: {id}} = this.props;
const indexOfCurrentElement = productTable.data.findIndex(obj => obj.id === Number(id));
const index = action === "next" ? indexOfElement + 1 : indexOfElement - 1;
const previousElement = productTable.data[index];
const path = `/products-setup/product-info/${previousElement.id}`;
browserHistory.push(path);
}
componentDidUpdate(prevProps){
if(this.props.location !== prevProps.location){
getProductById(
this.props.routeParams.id
)
}
}
changeContent = (action) => {
const {productTable, routeParams: {id}} = this.props;
const indexOfCurrentElement = productTable.data.findIndex(obj => obj.id === Number(id));
const index = action === "next" ? indexOfElement + 1 : indexOfElement - 1;
const previousElement = productTable.data[index];
const path = `/products-setup/product-info/${previousElement.id}`;
browserHistory.push(path);
}
componentDidUpdate(prevProps){
if(this.props.location !== prevProps.location){
getProductById(
this.props.routeParams.id
)
}
}