I’m reading the book Advanced React: Deep dives, investigations, performance patterns and techniques. In the first chapter, which is an introduction to re-renders, I’m struggling to understand the following text:
The only way for components at the “bottom” to affect components at the “top” of the hierarchy is for them either to explicitly call state update in the “top” components or to pass components as functions.
I understand the first part. An example would be the descendant component calling the set function returned by a useState
hook call from the upper-level component.
What about the second part, which is about passing components as functions? How is this supposed to affect the state?