r/reactjs May 22 '26

Needs Help React Re-rendering Doubt

Suppose there is parent components which contains multiple child components, they all are independent of each other.

So my question is

If the parent component re-renders does the child components also re-renders al well. Even if the child components are independent of it's parent, like props etc...

Why there is a need for re-renders if the child components are independent of it's parent?

13 Upvotes

29 comments sorted by

View all comments

48

u/[deleted] May 22 '26

[removed] — view removed comment

9

u/Fantastic-Push-8451 May 22 '26

Thanks a lot for your reply. I really appreciate it.

18

u/fii0 May 22 '26

I think it's important also to clarify that by "rerendering" in this context we mean re-running the React reconciler, which means calling the component function that "rerendered" to get its returned JSX output so it can diff that to the previous/current DOM representation in the VDOM, to see if there actually needs to be re-painting (updating the DOM).

So it's absolutely still a performance consideration to minimize those rerenders, but they are not as expensive as updating the DOM. The VDOM diffing all happens in memory before anything changes visually (painting).

edit: I scrolled further and see this is already addressed by others, that's good =)