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 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.
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.