Live data from Hacker News

Does anybody like React?

jsx.lol

181–190 of 353 posts

Re: Does anybody like React?

#181
React was one of those ways of building software that gave me back the giddy excitement I had learning Visual Basic as a kid.

It’s hard to explain, but the way everything was encapsulated as a component just clicked for me and suddenly the whole app could be composed.

I think it was when they introduced functional components. And when it comes to hooks, I love them.

Not to say other frameworks didn’t do the same, there was something special about React.

Re: Does anybody like React?

#182
post #13
post #8

I like React. And I have seriously tried the HTMX/Hotwire camp. I wanted to make a back button use browser APIs to go back if the coming from the inbox, just link to the inbox otherwise to preserve scrolling. I had to wire the actions from the html to call the function that goes back, then in my controller determine the previous page and send the JS enabled back button or the hard link. My logic was spread out over 3…

> I wanted to make a back button use browser APIs to go back if the coming from the inbox, just link to the inbox otherwise to preserve scrolling. I had to wire the actions from the html to call the function that goes back, then in my controller determine the previous page and send the JS enabled back button or the hard link. This is why I hate react spas. They're always trying to find some stupid way to break my bro…

They are actually speaking to trying to make an in-app back button use the history stack so that it _doesn’t_ “break” your browser’s back button.

The problem with just calling history.back() with no fallback is it will bounce users out of your app (back to Google or wherever they came from) and PMs won’t like that…

Re: Does anybody like React?

#183

I loved react in 2013 when it had the life cycle methods. Everything was deterministic, I knew what caused what where and when. Now every framework is a mess and I'm glad I won't have to learn anyone's crap anymore thanks to random code generators.

I lived there idea of hooks when they were introduced. But they’ve honestly not worked out. React works have been a lot better if the React team has figured out what useEffect was supposed to be right at the beginning, or at least when they changed what it was supposed to be used for they documented that clearly instead of gaslighting devs into believing nothing has changed. Also, hooks aren’t a thing. Each hook is i…

In every single project I worked on using Next.js as a kind of full stack framework, eventually I need to do something on the FE as well, and end up debugging a spaghetti of useSomething() until I figure out where to actually implement what I need.

Re: Does anybody like React?

#184

Earlier quoted context omitted.

I'm using Vue and do not feel it's becoming react

This sentiment only really applies if you’re coming from Vue 1/2 to Vue 3. The Composition API is definitely more like React but makes some better design decisions that make it easier to work with than React. Such as implicit reactivity.

If anything, composition API has taken the good parts from React. Once you get the hang of it, it’s amazing. Everything clicks together, is easily composable, and fully typed-safe.

Re: Does anybody like React?

#185

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

Terrific read thanks for digging it up

Re: Does anybody like React?

#186

Earlier quoted context omitted.

You might be interested in solid.js. To me, it's easier to work with than React. What I like about it is that the reactivity model is small enough that you can understand it, and even implement a basic version yourself. It also uses JSX, but since there's no virtual DOM, you can also write 100% JS, but, unlike React, you can do it without any special wrapper. So you don't need to use or write a `react-dnd`, just use…

I've tried solid and it's much nicer on small projects. How well does it scale though? Modern React is also 'more functional' (for some definition) but it comes at a cost of cumbersome and leaky abstractions. Classic React walked a fine line of being 'just reactive enough'. You could make code declarative and composable while still micromanaging certain lifecycle and data dependency decisions that can be critical for…

[dead]

Re: Does anybody like React?

#188
post #170

Earlier quoted context omitted.

I've tried solid and it's much nicer on small projects. How well does it scale though? Modern React is also 'more functional' (for some definition) but it comes at a cost of cumbersome and leaky abstractions. Classic React walked a fine line of being 'just reactive enough'. You could make code declarative and composable while still micromanaging certain lifecycle and data dependency decisions that can be critical for…

I've built quite complex applications (e.g. a spreadsheet app) using SolidJS as a base layer, and in that sense it scales really well. It's very easy to separate data management from the UI, so architecturally it scales well, and performance-wise we rarely had issues with it at all. The biggest issue is in finding people to work with it. If you're hiring React developers over web developers, they will probably strugg…

Implementing spreadsheets with fine-grained reactivity is basically cheating.

Re: Does anybody like React?

#190
post #8

I like React. And I have seriously tried the HTMX/Hotwire camp. I wanted to make a back button use browser APIs to go back if the coming from the inbox, just link to the inbox otherwise to preserve scrolling. I had to wire the actions from the html to call the function that goes back, then in my controller determine the previous page and send the JS enabled back button or the hard link. My logic was spread out over 3…

I know there will probably be some complications here and there, but this could be done with Web Components too, right?

Yes you could, or even just a vanilla DOM event handler on a button click.

The problem is that you cannot introspect the browser’s history with the history API. So you have to hack your way around that if you want the “go back in history if possible, otherwise navigate to fallback url” behavior. Which I guess is easier if you’re in a react SPA. Or if you’re fully a MPA and can just check document.referrer

There’s a brand new Navigation API that does let you introspect history entries from the same origin, which perfectly addresses the issue.

I wrote a polyfill in order to take advantage of the navigation API for this exact problem: https://github.com/kcrwfrd/navigation-ponyfill

Post reply on HN