2 ms·
> Some very basic things like show/hide images and blocks of text based on user selection require an obscene amount of code/complexity in React That’s just a t
by christophilus 4y ago
> Some very basic things like show/hide images and blocks of text based on user selection require an obscene amount of code/complexity in React
That’s just a ternary conditional in React. How is it complex?
- CharlieDigital 4y agoI'd encourage you to write it once in vanilla and once in React in jsfiddle and compare the implementations. Then consider the render model and how it would affect page time to interactive for a large content oriented page.
- christophilus 4y agoI’ve written this sort of thing in both. Personally, I find the “make your view a function of your state” approach to be much easier to reason about and more maintainable. Obviously, not if the only thing your site does is this one feature. But as soon as your site becomes non-trivial, I prefer the functional / React approach.
- hombre_fatal 4y agoWell, frameworks vs vanilla JS doesn’t cash out into whether it’s hard to write ‘element.style.display = “…”’ or not.