A
A
alex4answ2020-12-14 16:14:28
React
alex4answ, 2020-12-14 16:14:28

Re-rendering a component without state and props?

Good afternoon, there are 2 components, the parent uses the redux store, the child is a simple component, does not accept props, does not have its own state, does not use the context / store, the simplest component.

But for some reason, when the state of the parent changes, this simple component is re-rendered, why?

As I understand it, React, when changing the state of a component, renders it again and its children (if something is passed to them in props) then compares and updates what needs to be in the DOM, did I understand correctly?

But then why is the component re-rendering, which takes no parameters?

Maybe I didn't quite understand how re-rendering happens.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question