3 ms·
So your thesis is that, because not all react code is written perfectly, react is bad for the web and we should rewrite everything in svelte? React has flaws.
by scrollaway 4y ago
So your thesis is that, because not all react code is written perfectly, react is bad for the web and we should rewrite everything in svelte?
React has flaws. Performance isn’t really one of them. When you have hot paths in your app, you will/should be looking at those like an engineer looks at the high stress points in the item they just designed: extra work that covers those exact points.
The example you gave is weird. Comparing lists and strings in a setter is fine for most of reacts use cases even if its performance could be better, because it isn’t slow. It’s only slow when you hold it up against, say, comparing numbers, but the reality is your bottleneck will be elsewhere, such as in web requests or some such.
And if you’re writing anything beyond a small component anyway you’d be using ids in your scenario. Especially if you’re writing a library.