DEV Community

Discussion on: Reactivity Anywhere - without virtual DOM

Collapse
 
stereobooster profile image
stereobooster

But virtual DOM has nothing to do with reactivity. Virtual DOM needed for declarative style programing - you don't need to manually change state of each element instead you return new JSX and VDOM will figure out what actually changed and apply the difference to the DOM

Collapse
 
retronav profile image
Pranav Karawale

@stereobooster Actually, virtual DOM has different meanings that vary with context. So basically, I'm talking about the reconciliation that happens after there is some state change happening in the app. So I basically wanted to remove the extra reconciliation step and to keep states directly in sync. I hope you understand what I mean. So instead of returning a new element each time a state change is triggered, the existing element can be mutated; this will certainly avoid unnecessary logic and speed things up. If you have a good title for this post, please feel free to tell me :)

Collapse
 
stereobooster profile image
stereobooster

This is your article you can name it what you want (obviously). Alternatives: "You may not need Virtual DOM" 🤷‍♀️

I'm just saying that React is not reactive and Virtual DOM is not for reactivity it is to make declarative style (return of the whole JSX) possible.

Shawn Swyx Wang - Why React is not Reactive

Thread Thread
 
retronav profile image
Pranav Karawale

Oh, now I get what you want to say, @stereobooster . But anyways, it was just an experiment :)