Comment Comment by hombre_fatal React's threejs/pixijs bindings are a great example of what vdom diffing can let you do.Since they bring their own reconcile(a, b, diff) function to React, these libs can turn: const world = new World() const player = new Player() world.add(player) // somehow wire up the code to keep // player.pos updated Into: const [x, setX] = useState(0) return <World> <Player x={x} /> </World> In other words, you write declarative code, and it does the hard imperative work of adding/removing/disposing/updating things for you.Just like how it helps you sync your data model to underlying stateful DOM nodes; the idea can be applied on top of any stateful system. parent hombre_fatal 1 year ago
Since they bring their own reconcile(a, b, diff) function to React, these libs can turn:
Into: In other words, you write declarative code, and it does the hard imperative work of adding/removing/disposing/updating things for you.Just like how it helps you sync your data model to underlying stateful DOM nodes; the idea can be applied on top of any stateful system.