At the root of my App I have two React components, Menu and Main. The Menu is hidden by translating it to the left outside of the viewport. When it is visible, I also want the Main content to translate to the right. In order to do that I simply pass a menuOpened property (boolean) to both components. It will apply a conditional style that setup the CSS transform property translateX(). The problem is, when I update the prop, all the children will re-render. Is there a better practice for changing style of a component depdending of a state / props?