Live data from Hacker News

Ask HN: I can no longer like React, do you?

news.ycombinator.com

31–33 of 33 posts

Re: Ask HN: I can no longer like React, do you?

#31
post #16

React is the Spring of frontend frameworks. If you have used Spring framework around 2010ish with Hibernate as ORM, you'd know what I am talking about. React with its component ideas was a smart and the first of its kind, yes. But its evolution is regrettable. The idea of hooks is so.... that it would be considered spaghetti code in any other realm of software engineering. I have switched to Svelte. I don't like ever…

> React with its component ideas was a smart and the first of its kind, yes.

Tldr: React is just a port (the original version).

Just as an FYI, The main concepts of react were first created in PHP. It was called XHP and was latter ported to JavaScript by Facebook. This is why old React was class-based (because php is a class-based OO language).

https://web.archive.org/web/20130821190221/https://github.co...

Re: Ask HN: I can no longer like React, do you?

#32

Another "I hate hooks" sentiment. Nothing new, or unlike countless other takes online.

just from pure api perspective how is setA, setB, setC better than...

this.setState({this.state: val})

which was already pushing limit of normal behavior which is

state.A = val

just to be revise

i went from having to do

state.onlineStatus = 'active'

to

const [onlineStatus, setOnlineStatus] = useState('active')

Instead of being able to get autocomplete and normal refactoring you would get from plain js.. now you need to add typescript to supplement the mess...

const obj = {

onlineStatus: 'inactive', shoppingCart: '3899x', lastActive: 1834393939 }

obj. [autocomplete anywhere in the project]

vs MORE Boilerplate

Re: Ask HN: I can no longer like React, do you?

#33

Never understood this posts. React as a whole and state management became many times easier over the years (been working with it, vue and a bit of angular for 6+ years now). Function components removed stuff like getDerivedStateFromProps and many other things, introduced clear and simple way of component updating (as in "prop reference changed, I'm gonna render now"). For state we got redux toolkit, which simplified…

I rather like React, but its names for things (like "getDerivedStateFromProps") are always just godawful. They're wordy, and even all of those words really don't make the purpose clear.

I was always particularly aggrieved by "mapStateToProps", which obfuscates that it's referring to the Redux state rather than the thing that's actually called "state" in the component. And why the heck are we mapping it into the props? (Not that "useSelector" is any great model of clarity, but at least it's a compact verb-noun pair.)

Post reply on HN