News for hackers. Stuff that matters.
Re:The self-fulfilling prophecy of React by woojoo666 on Thursday September 08, 2022 @09:05AM (#32764908)
Any examples of places you think React's design does better than say, Vue or Svelte?
Re:The self-fulfilling prophecy of React by wokwokwok on Thursday September 08, 2022 @08:26PM (#32773858)
I 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

Compared to having “{node}” in react.

Re:The self-fulfilling prophecy of React by eyelidlessness on Thursday September 08, 2022 @09:19PM (#32774164)
They 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.
Re:The self-fulfilling prophecy of React by wokwokwok on Friday September 09, 2022 @05:48AM (#32777307)
Re:The self-fulfilling prophecy of React by spartanatreyu on Thursday September 08, 2022 @10:24PM (#32774573)
What 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?

Re:The self-fulfilling prophecy of React by danieltanfh95 on Friday September 09, 2022 @01:19AM (#32775589)
Yikes. That does not look sane to me. Duplicate vnodes doesnt work, so you HAVE to use some function to generate it instead?
Re:The self-fulfilling prophecy of React by localvoid on Friday September 09, 2022 @01:31AM (#32775645)
> 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.

Re:The self-fulfilling prophecy of React by bayesian_horse on Thursday September 08, 2022 @09:52AM (#32765507)
In my opinion, two-way bindings are evil...
Re:The self-fulfilling prophecy of React by jesuscript on Thursday September 08, 2022 @08:26PM (#32773855)
For simple inputs it’s fine. What are really solving by methodically doing that one-way?
Re:The self-fulfilling prophecy of React by Marazan on Friday September 09, 2022 @02:37AM (#32776022)
Two 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.