DEV Community

Discussion on: Advanced Reactjs

Collapse
 
silentwarrior profile image
João Carlos

How is this any different than passing the same data via props?

I don't understand the benefit of doing it this way instead of doing it the "proper" way via properties.

If anything, you are making a simple concept harder to understand and read.

Also, aren't you dropping performance by cloning the elements on every render call?

Collapse
 
sait profile image
Sai gowtham • Edited

There is only single state present in the entire code and also the state is accessible to all child components if I need to change the state from the heading component all components are updated with updated state.

If i need to render the Text component above and heading component below still it works without changing any code in the text component or heading component.