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.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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?
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.