How do the old js objects in react virtual dom compare with the new js objects (at the code level) how to implement

I hear it"s a sibling comparison, but how to implement
by code, such as
Old js object
{"div","class=a", {children}}
New js object
{" div","class=b", {children}}

comparison between js object and js object

1. I want to know what method (code) is used at the bottom to compare
is it traversal?

2. Did you find the child nodes behind the differences and no longer compare them? Directly delete and then regenerate?

May.19,2022

class VNode {
  constructor (tagName, props, children) {
    this.tagName = tagName
    this.props = props
    this.children = children
  } 

  render () {
    const { props, children } = this,
      dom = document.createElement(this.tagName)
    Object.entries(props).map(([key, value]) => dom.setAttribute(key, value))
    children.map(o => dom.appendChild(o instanceof VNode ? o.render() : document.createTextNode(o)))
    return dom
  }
}

const h = (tagName, props, children) => new VNode(tagName, props, children)

learn about the createClass of react


https://zhuanlan.zhihu.com/p/...

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b34a2c-2b777.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b34a2c-2b777.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?