Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

does parent component re-renders when changes occur in child components?


I have a parent component which looks like this:

const Parent = () => {
    return (
       <Child_1 />
       <Child_2 />
   );
}

if any changes occur in one of the child components, will the Parent component re-renders ?

like image 520
Anubhav Kumar Yadav Avatar asked Dec 30 '25 14:12

Anubhav Kumar Yadav


1 Answers

No, it will not re-render. If you pass any props to the component from the parent component and you update that prop in children or that prop update in the parent component so both will re-render. But if the data or state has no dependency on the parent component so it will not cause a re-render in the parent component.

like image 190
Azeez Avatar answered Jan 01 '26 08:01

Azeez



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!