A
A
Alexander Kositsyn2018-02-27 15:27:12
JavaScript
Alexander Kositsyn, 2018-02-27 15:27:12

Will the entire application be re-rendered if some internal (somewhere in the application) state of one of the components changes?

Let's say we have an application.
Here is such a structure

<App>
  <Header/>
  <Footer/>
<App/>

The header and footer have their own state.
If somewhere in the footer there is a button that updates the state of the footer, will the entire App. or only Footer which has its own state?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2018-02-27
@alex_keysi

Of course not. Only "that part" (that component) is rendered (redrawn) in which the props/state were changed + all children if they do not have optimizations (for example, they can be made as stateless, pureComponent or have shouldComponentUpdate - then they will not be redrawn with the described conditions).
I see the question has been updated: yes, only the footer.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question