5 ms·
Any examples of places you think React's design does better than say, Vue or Svelte?
by woojoo666 4y ago
Any examples of places you think React's design does better than say, Vue or Svelte?
- bayesian_horse 4y agoIn my opinion, two-way bindings are evil...
- jesuscript 4y agoFor simple inputs it’s fine. What are really solving by methodically doing that one-way?
- Marazan 4y agoTwo way data bindings works in the absolutely most trivial case. As soon as you go any amount of complexity higher in your program two way databinding is pure poison. Two-way databinding is the absolute very worst feature people took from Flex.
- wokwokwok 4y agoI had the unfortunate job of learning vue recently and it sucks hard at some edge cases. Specifically, imagine you a component that takes an arbitrary node to render. Just pass the node to the temple right? Ha. This api sucks -> https://vuejs.org/guide/extras/render-function.html https://vuejs.org/guide/extras/render-function.html Compared to having “{node}” in react.
- eyelidlessness 4y agoThey are almost literally the exact same API. Prior to the “automatic JSX transform”, they were basically identical. That’s how both libraries support JSX, which isn’t always exactly a mapping to h but is almost totally in both React and Vue (and Preact, and even in Solid if you ignore recommendations to use its custom JSX transform). The API you’re criticizing is specifically good because it enables what you prefer in React.
- wokwokwok 4y agohttps://stackoverflow.com/questions/49352525/can-you-render-vnodes-in-a-vue-template https://stackoverflow.com/questions/49352525/can-you-render-...
- spartanatreyu 4y agoWhat do you mean by a component that takes an arbitrary node to render? Do you mean a component that renders out to a node? Or a component that takes in a node external to the component so it can render to that external node (as opposed to or in conjunction with a node inside the component)? If the first, isn't this just the job of the component's <template> or jsx? If the second, isn't this what slots are for?
- danieltanfh95 4y agoYikes. That does not look sane to me. Duplicate vnodes doesnt work, so you HAVE to use some function to generate it instead?
- localvoid 4y ago> Duplicate vnodes doesnt work, so you HAVE to use some function to generate it instead? Yes. Mutable vnodes is a huge mistake that I've done long time ago when I've tried to figure out how to write efficient diffing algorithm (2014-2015), and a lot of libraries copied that terrible idea without deep understanding why I've done it in the first place.