Live data from Hacker News

Does anybody like React?

jsx.lol

261–270 of 353 posts

Re: Does anybody like React?

#261
post #216

Earlier quoted context omitted.

I never get this take. A react component is not just a function, it's a function plus a magically injected context that is accessed through hooks which requires all kinds of guarantees that you have to be aware of otherwise it will have hard to debug consequences. Imo it's anything but elegant. I did projects in all major frameworks and am building a huge angular web app currently. In angular a component is represent…

> I never get this take. A react component is not just a function, Exactly. I did a somewhat longer writeup a while back. https://blog.metaobject.com/2018/12/uis-are-not-pure-functio... The pull request is still open :-)

Interesting that you still stand by that, even after Apple moved to the exact same model with Swift UI.

Narrowmindedly worrying about syntactical differences is contributing nothing to the conversation. The point is relinquishing control of state to the framework (be it via props, hooks or @State), and drawing the UI as a pure representation of whatever the framework tells you. Hence ui = f(state). This gets you a metric ton of advantages, which is why every modern framework is doing it.

Classes, by themselves, are inadequate as containers for state unless that state must only exist in memory and never be observed, synchronized or serialized. You can attempt to patch that with decorators, ORMs or whatever, but now you're doing the same thing as React is doing with functions.

Re: Does anybody like React?

#262

Earlier quoted context omitted.

But why over vue? My biggest frustration has been how vue ends up moving in the direction of react. The original component architecture with the html template, JavaScript state and css styles in vue was so nice. Even the data fetching a url in the component was so intuitive.

A bit out of date, but I like the point-of-view of "The single most important factor that differentiates front-end frameworks" : https://mjswensen.com/blog/the-single-most-important-factor-...

Fantastic article. It is strange that such important aspects of JS frameworks are so rarely discussed.

Re: Does anybody like React?

#263

As someone who lived through all major waves of JS for the last ~16 years, I do love react, in a sense: React is the worst JS framework except for all the others we've tried. I'd take React over the Angular 1 days any time. I'd take Angular 1's full-bodied MVC over the "build it yourself from scratch every time" approach of Backbone. I'd take Backbone's minimal MVC structure over the classic JQuery Soup architecture.…

But why over vue? My biggest frustration has been how vue ends up moving in the direction of react. The original component architecture with the html template, JavaScript state and css styles in vue was so nice. Even the data fetching a url in the component was so intuitive.

as long as JSX never becomes default in Vue, vue is still winning

Re: Does anybody like React?

#264
post #178

Its bloat. You can do shadow dom and web components in modern native JS. State library is prob all you need now.

> State library is prob all you need now. Hopefully if the signals standard proposal (TC39) gets up we may not even need state libraries soon.

Neat! Had not heard of this, lets goooo!

Now if they could just make Typescript semantics native.

Re: Does anybody like React?

#266
post #124

Earlier quoted context omitted.

JSX is abc turns into createElement('div', null, 'abc') and you can use that instead of JSX if you like or you can use something like hyperscript. Everything else like mapping or if statements is pure JS and works just like JS anywhere else in your app. Vue templates mean learning Vue's custom syntax for if statements, loops, dynamic attribute syntax (with its own gotcha), binding dot modifiers, data binding, and wha…

Vue supports JSX, though to be fair, it’s not idiomatic and hence never shows up in any docs.

thankfull. i find reading JSX A visible eyesore, like an LLM reached its comtext length and just snorted blood and bile out its nose

Re: Does anybody like React?

#267

One of the talks I really enjoyed is https://www.youtube.com/watch?v=h9SDuTSy7ps . In my experience, React's architecture is really good and lends itself quite well to making large applications. Unfortunately, React's biggest problem is that it forces you into the JS/TS ecosystem, which is, without a doubt in my mind, a compilation target rather than a system I wish to interact with natively. I'm happy with Elm -- th…

I like TEA but don't fully grasp how it scales for apps that may have reusable components or sufficiently complex pages. Is there an agreed-upon way(s) to deal with this? I know state is a big NO so it seems a bit at odds, but also does this essentially mean all Elm apps are just a global Redux and React app with no effects? Curious about more details to what you enjoy and how you like to work in Elm. Links also perf…

Not the person you were asking, but I shall share my experienc..

>how it scales for apps that may have reusable components or sufficiently complex

It is a lot of boilerplate, but it is mechanical, straightforward changes. I think it is entirely possible to automate it (not even using LLM).

> state..

I have used ELM ports to interact with JS and localstorage/indexeddb.

Re: Does anybody like React?

#268
post #99

Earlier quoted context omitted.

I have never been able to pick the framework and libraries for my day job. I’m almost always working on something someone started years prior or bound to an organization that has strict choices. Personally I wouldn’t pick react :) React wins because it has become a default choice and folks like what’s comfortable to their preferences

React wins because it has a predictable interface that has become industry standard. Industry standard saves money. Not everything must be creative .

React is bad exactly because this predictability doesn't exist, it changed radically for the worse at least 2 times without any consultation to the community

Re: Does anybody like React?

#269

Earlier quoted context omitted.

The same kind of bugs don’t happen in Vue because the framework handles them for you.

Maybe fair maybe not, but definitely unrelated to how intuitive it is.

I'd argue that it's directly related. If intuitive use of a library/framework/pattern commonly causes issues, you have to keep forcing yourself to do use non-intuitive approaches to prevent them.

GOTO is also pretty intuitive.

Re: Does anybody like React?

#270
post #39

I like SvelteKit but frameworks are converging to have similar features. React has a compiler. Vue is doing away with VDOM and Svelte has 'Runes' which is a bit like Solid's signals.

vue is adding a vdom less route. but not going away from it anytime soon
Post reply on HN