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?
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...
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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?
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...