4 ms·
I understand this is an opinionated comment, but I thought I'd reply because IMO there's some conflation here regarding what "React" is. > As author points out
by aylmao 7y ago
I understand this is an opinionated comment, but I thought I'd reply because IMO there's some conflation here regarding what "React" is.
> As author points out, what in the world does a <Query> tag even do?
This is not "React". This API was Apollo's decision, but just like you see libraries that lean heavily in the "everything is a component" direction, others don't. I personally use and like React quite a bit, but find this heavy use of HOCs in some 3rd party APIs a little weird.
> And everyone just bought into it because the guys at Facebook must be really smart.
Facebook builds and uses Relay which doesn't do this, which doesn't use HOCs like these ones Apollo does.
> The lifecycle hooks are just confusing and unnecessary.
It's fair to call them confusing if you feel that way, but I don't think you can say they're objectively unnecessary. They've all come pretty handy at some point or another in my use of React. Learning the lifecycle of a React component allows you to effectively integrate it with libraries that were never built with React in mind— I've used D3 + React extensively and and being able to do different D3 operations at different points in the component lifecycle makes it all work seamlessly.
> they change every few versions (so old code will inevitably break on new React versions).
Do they? React is pretty good about backwards-compatibility as far as I have seen. Wasn't the last breaking change with the release of 16, like 2-3 years ago? They also tend to make code-mods available to automatically migrate things, which can come in pretty handy.
> Boy do I miss the days when I was building stuff in PHP and HTML was simply rendered when I ran the damn thing.
I do miss this too (although it hasn't gone away!), but this is not endemic to React. It is really is a traded-off to make when choosing to make a site rendered by JS (with all the advantages and disadvantages it brings) or the server (ditto).