It’s a misremembering of history. The point of all the “pure functional” discussion was that rendering the UI now shouldn’t depend on how the UI was rendered earlier. The idea was to move away from the “create then update” paradigm to just “render”. React would be responsible for which elements need to be created and which can be updated in place.
To achieve that, it doesn’t matter whether the state is local to a component or global across the application.
> React would be responsible for which elements need to be created and which can be updated in place.
That works for simple, read-only components. The moment the component starts managing its own interactivity you end up needing state, and at that point things break down. If you need to change props, you have to essentially recreate the component by changing key [1], and at that point, what is the benefit of React?
To achieve that, it doesn’t matter whether the state is local to a component or global across the application.
reply