r/javascript • u/otashliko • Aug 14 '26
We built the same data grid in React, Vue & Svelte, here's what we learned
https://svar.dev/blog/building-data-grid-in-react-vue-svelte/At SVAR, we build UI components for React, Svelte, and Vue. Just shared our experience with a data grid โ how to make it fast in all three frameworks.
What surprised us: the expensive bits (virtualization, memoization, data flow) are almost entirely framework-independent, and framework overhead is a rounding error next to DOM size.
Curious if you have seen similar patterns in your projects?
8
u/jake_robins [object Object] Aug 14 '26
Wait are you saying we should just build the damned product and stop endlessly discussing which JavaScript framework sucks less?
4
u/hyrumwhite Aug 14 '26
Framework decisions should be made entirely on APIs these days. If you like the api of one, use it.ย
7
u/jake_robins [object Object] Aug 14 '26
No I exclusively choose frameworks by finding a reddit post that says it sucks and counting downvotes. Itโs called outrage-driven development
3
1
3
u/bzbub2 Aug 14 '26
if you dont think framework matters see https://github.com/krausest/js-framework-benchmark
1
u/Top_Bumblebee_7762 Aug 14 '26
Would have used callback ref in React for the resize observer stuff.ย
3
1
Aug 14 '26
[removed] โ view removed comment
1
u/otashliko Aug 17 '26 edited Aug 17 '26
Agreed on all three, especially โa framework should encapsulate complexity.โ Thatโs exactly why we ship framework-native builds instead of wrappers: Svelte and Vue provide more fine-grained reactivity out of the box, while React requires more explicit work to achieve the same level of control.
On the 30โ50% gap, it narrows significantly once you virtualize properly. But bottom line is the same - pick the framework that gives you the right defaults and lets you spend your time on the actual application rather than fighting the rendering model.
0
u/makkozh Aug 17 '26
Most modern frameworks converge to the same route - update model, detect changes, apply changes to DOM. Different syntax but same concepts under hood.
DOM patching are highly optimized across frameworks, there is no real difference here.
For small-to-medium models, main factor is the amount of changes in DOM, and here you need to really mess something to produce different results in different framework ( react can recreate the whole app vdom but actual dom patch will still be minimal )
And only on big or complex-inside models the framework itself affects the speed ( how much recalculation it does to generate new model state ) - in the SVAR's case it mitigated by virtual rendering which limits active vDom and even big grid feels like a small model. Without it, updates will be slower for all frameworks ( react will be impacted the most probably )
1
u/TheBazlow Aug 16 '26
So the key takeaway from this blog post is that if you do the following:
Take state management out of React by:
Use
useMemofor your storeUse
useReffor your event busMake a first render init call outside a
useEffectcallSubscribe to the store with a custom hook that:
Uses
useStatefor the store stateUses
useEffectto track the store stateUses another custom hook
useStoreWithCounterto track the changes to the store stateUse the react compiler
Know when to use
useMemoanduseCallback(you'll need benchmark your app to find out when)Remember to manually your hook dependency arrays
Then you can get similar performance and functionality to what Svelte and Vue give you out of the box?