zok
zok

Reputation: 7882

How to make non-sibling elements have the same height in React

Is it possible to make non-sibling elements to have the same height (the height of the tallest one) in React?

That obviously cannot be done with CSS. That would be fairly easy to do with JavaScript but I'd have to rely on DOMNodeInserted event since the elements I'm working with are dynamic and I'm pretty sure that wouldn't work with React.

Any ideas?

Upvotes: 0

Views: 589

Answers (1)

An Nguyen
An Nguyen

Reputation: 1478

With a pure React solution, you have to redesign your CSS, or redesign your React component hierarchical.

Or you can use a state manager like Redux or Alt. If your application is not too big, I recommend Alt since it is simpler.

Upvotes: 1

Related Questions