Hi I have four divs in a bootstrap row. I want all divs in this row to have the same height and not break responsibility. I don\'t know how to do this without breaking respo
For people who are coming here for this solution in React, here it is:
constructor(props) {
super(props);
this.state = {
maxHeight: undefined,
};
this.putBootstrapColumnSameHeight = this.putBootstrapColumnSameHeight.bind(this);
}
componentDidMount() {
this.putBootstrapColumnSameHeight();
}
putBootstrapColumnSameHeight() {
const heights = [];
document.querySelectorAll('.col').forEach(el => heights.push(el.clientHeight));
this.setState(
{
maxHeight: Math.max.apply(null, heights),
},
);
}
Then to your columns :
// etc..
// etc..
Enjoy ;)