Live data from Hacker News

React Makes You Sad?

github.com

81–90 of 211 posts

Re: React Makes You Sad?

#81
post #21
post #12

Earlier quoted context omitted.

This is the weirdest argument I've ever heard against React, and, as someone who does a fair bit of React work, I try to pay attention to all those arguments.

It's certainly a weird phrasing of an argument. However, it seems reasonable that some programmers will not like the specific style of structure that react espouses. Specifically the top-down push of data through parent-child component relationships. Specifically, if you are working with a lot of third party components that are not react based, it can be hard (or a lot of boilerplate) to contain them within react app…

> the top-down push of data through parent-child component relationships

This is a conventional approach when working with the DOM, since the XML is organized as a tree. Plus it happens to work nicely with their intended data flow pattern. But you make an interesting point, what about UIs that don't fit nicely into the document paradigm? Are there cases where it would be better to organize UI components in a graph, for example?

> if you are working with a lot of third party components that are not react based, it can be hard (or a lot of boilerplate) to contain them within react applications.

In my experience integrating third-party UI components has been much easier than I would have guessed. The difficulty has not really been in wiring the React parts to the component's API, but in making a stateful third-party component behave in a stateless fashion.

Re: React Makes You Sad?

#82

Earlier quoted context omitted.

...where "other peoples mess" is based on battle-hardened production code from Facebook...

"battle-hardened", yet churns drastically every release? You and I have different ideas of what battle hardened means.

I have a react app that is almost 2 years old now and the only change I had to make was when they moved a function from the React to the ReactDOM namespace.

Re: React Makes You Sad?

#83
Although I like this a lot, and I think it addresses most individual nuggets of React Sadness in a pretty reasonable way, I am still sad.

I am sad because every process rectangle in this chart should also point to a decision diamond that says:

"Does it seem that the entire industry has migrated to this stack, whether or not it really makes sense for everyone to? That a feedback loop now influences shops to choose these tools/technologies not because they are called for, but simply because they are trendy? That present excitement outweighs the question of 'whether you need this or not' in the eyes of most of your peers and colleagues? That the incentive to not get left behind is stronger than the incentive to stop and consider?"

And then, that diamond should point to a final rectangle that says:

"If you wish to remain employable, learn React + Redux + ES2017 + Webpack now, or join a different sector of the industry. As for the sadness, deal with it."

This isn't only true of React, of course. The underlying sadness comes from watching one's valid hesitations drowned out by the mob.

Re: React Makes You Sad?

#84

Earlier quoted context omitted.

"battle-hardened", yet churns drastically every release? You and I have different ideas of what battle hardened means.

Can you please help me understand the issue by providing a specific example of how a new React release introduced churn in your project?

Sure, I started a react project and got everything working with es6 and babel in October. In December I upgraded to react 0.14 and had to refactor all the things. It was extremely difficult to figure out how to solve some of the arbitrary-seeming changes, such as now having to re-bind all of the methods in the constructor.

Re: React Makes You Sad?

#85
I don't know what's worse. A poorly-worded expression of someone's experience with React, or the no-info-or-even-attempt-to-understand judgment from you. Oh man, you're a guy who does a fair amount of React work and tries to pay attention to weird arguments against it? Let me immediately downvote that guy and upvote you!

What's so weird about someone not enjoying the rigidity React offers and realizing that Facebook prefers this style since it has an army of programmers that would do well to stay in style with one another?

By the way, I remember you. You're that guy who was relentlessly defending Facebook's chief of security in the comment thread after he acted like a scumbag. It was so weird how you responded to nearly every comment vindicating your pal.

Re: React Makes You Sad?

#86
post #82

Earlier quoted context omitted.

"battle-hardened", yet churns drastically every release? You and I have different ideas of what battle hardened means.

I have a react app that is almost 2 years old now and the only change I had to make was when they moved a function from the React to the ReactDOM namespace.

It wouldn't happen to be open source then would it? Perhaps I'm just React-ing wrong.

Re: React Makes You Sad?

#87
post #74

Earlier quoted context omitted.

While domvm [1] is young and doesn't have the adoption of Mithril (not even within an order of magnitude), it does solve many issues that people frequently have with Mithril's architecture and magic. Check it out if you'd like. Disclaimer: I'm the author and 1.0 (stable) target is April 1st. [1] https://github.com/leeoniya/domvm

You might wanna rethink that target date (April Fool's Day).

It's a half-joke date. I'm the only dev and there's still a crapload of docs and tests to write. If I can't hit it, then at least I have a good April Fools joke prepared :)

The project, however, is quite serious.

Re: React Makes You Sad?

#88
post #28

Earlier quoted context omitted.

What were you doing?

Writing a 'driver' to integrate my low level UI component library to be usable with React. My major issue was the 'rule' that a parent can't access the 'state' of it's children; this turned a 2 hour job into a 3 day job for me just trying to find a way to get access to this state through all of the lifecycle callbacks while instantiating children at the same time. When asked in #reactjs, they said that if you need ac…

I had the same problem until I saw the light. The problem wasn't React: it was me.

You shouldn't merely learn React, but also unidirectional-flow architectures (like Flux, but there are many others, including better ones IMHO). Bidirectional data flow is a pain in the ass and once you understand unidirectional data flow, everything fits much easier. Of course, trying to shoehorn a bidirectional data flow in React is going to cause a lot of pain.

If you still need a bidirectional data flow, messing with lifecycle callbacks is definitely not the way to go. It seems to me you didn't have problems with React. You had problems learning React.

Re: React Makes You Sad?

#89
post #72
post #28

Earlier quoted context omitted.

Writing a 'driver' to integrate my low level UI component library to be usable with React. My major issue was the 'rule' that a parent can't access the 'state' of it's children; this turned a 2 hour job into a 3 day job for me just trying to find a way to get access to this state through all of the lifecycle callbacks while instantiating children at the same time. When asked in #reactjs, they said that if you need ac…

Put ref properties on the child components. Put public methods on the child components. You can then access the refs from the parent in the parent's componentDidMount or componentDidUpdate methods.

Tried that, couldn't figure out how to get it to work. Still didn't have access to child's state.

Re: React Makes You Sad?

#90

I don't know what's worse. A poorly-worded expression of someone's experience with React, or the no-info-or-even-attempt-to-understand judgment from you. Oh man, you're a guy who does a fair amount of React work and tries to pay attention to weird arguments against it? Let me immediately downvote that guy and upvote you! What's so weird about someone not enjoying the rigidity React offers and realizing that Facebook…

Thanks.
Post reply on HN