3 ms·
The fundamental differences are quite stark. Vue, Svelte, web components, and vanilla only execute code that is marked as a callback. Example: let x = 0
by CharlieDigital 2y ago
The fundamental differences are quite stark.
Vue, Svelte, web components, and vanilla only execute code that is marked as a callback.
Example:
let x = 0
var counter = computed(() => ... )
In this Vue snippet of an SFC, the callback in the computed executes in reaction to some change without invoking the assignment of x (obviously a trivial case here).
DOM + JavaScript is the same
React invokes the entire component function and all calls and allocations in the path of the component function. The mental model is inverted in a sense.
This is one of the reasons React generally performs more poorly in both speed and space.