Если вы установите стиль вашей строки для использования переменной состояния, вы можете установить эту переменную в CompomentDidMount. Нечто подобное ниже.
class Foo extends React.Component {
constructor(props) {
super(props);
this.state = {
minHeight: 0,
};
}
componentDidMount() {
// Or however you get height from a ref
const fooHeight = this.elementFoo.clientHeight;
const barHeight = this.elementBar.clientHeight;
const minHeight = fooHeight > barHeight ? fooHeight : barHeight;
this.setState({ minHeight });
}
render() {
const { minHeight} = this.state;
return (
<div style={{ 'min-height': `${minHeight}px` }} ref={elm => (this.elementFoo = elm)}>Foo</div>
<div style={{ 'min-height': `${minHeight}px` }} ref={elm => (this.elementBar = elm)}>Bar</div>
}
}