DEV Community

Discussion on: React Beginner Question Thread ⚛

Collapse
 
bhagatali profile image
Ali Bhagat

Hey Dan! I have followed your work a lot and have looked to your ideas and suggestions on how to approach certain problems in React. Thanks a ton for all your effort in the React community. A lot of people benefit from you.

Recently I had a bit of a problem using a React parent container which had two sibling containers in it. One of the use cases I had was, when one of those child component changes, the other sibling had to re-render. I was able to manage this but it looked really cumbersome. Is there a good practice or suggestion on how to efficiently manage this?

Collapse
 
dan_abramov profile image
Dan Abramov

You can make one of the sibling components descend from React.PureComponent. This gives you a nice opportunity to “skip” updates when state and props are shallowly equal. See also: reactjs.org/docs/optimizing-perfor...