|
|
|
|
|
by eyelidlessness
2237 days ago
|
|
> virtual DOM implies DOM existence No, it doesn't. I addressed this in the comment above. React's virtual DOM has been used to render: - Plain HTML (e.g. server-side rendering)
- Native UI framework objects (e.g. React Native)
- Text-based interfaces (e.g. Ink)
- Smart TV devices (e.g. Netflix's Gibbon)
- Browser `<canvas>` elements
- Markdown formatted text And a whole bunch of other targets. > DOM based systems use so called retained mode rendering. But this one uses something that can be classified as immediate mode rendering. This seems orthogonal to the question? I'm not trying to be difficult, I sincerely don't understand why this would mean the two are "not even close". |
|
React Native uses DOM, the only nuance is that that DOM is a tree of native widgets/windows which is a perfect DOM.
Again, virtual DOM is a projection of real DOM in one form or another. It could be a tree of anything that can be represented by attributed nodes and leaves.
DOM tree has nothing with rendering and pixels, that's why "not even close". By using virtual DOM you can update (by diffing) some tree that even has no visual representation in principle - it is pure data structure. Think about abstract XML config that can be reconciliated with its virtual DOM.