Live data from Hacker News

What I wish I knew about React

bitsofco.de

161–170 of 301 posts

Re: What I wish I knew about React

#161

Earlier quoted context omitted.

Would it be possible to have a single method on a class that behaves like whatever useEffect is doing?

Not in a single method, no. Watch this talk for more details! https://www.youtube.com/watch?v=wXLf18DsV-I

Well, I did something a bit similar my own language: https://github.com/batiste/blop-language/commit/90e7704e125f... Not sure where classes are an issue with doing anything like this

Re: What I wish I knew about React

#162
post #83

I am not so up to date with frontend dev but what's with the hate towards React these days? It still does what it's supposed to do very well and very fast. Yeah sure if you want JSX you need transpilation but I would want that anyway if I want any of the ES6 features without losing browser compatibility. And it's also constantly evolving and getting better. Just recently I started a React project with class component…

I love React and write it, in Typescript, on a daily basis. However:

- It starts you off with about 40kB of minified gzipped javascript; some developers feel that it's too much.

- It is not and probably never will be the most performant framework out there, which upsets quite a few people (although the work that the React core team is doing with Concurrent Mode probably means that from the end user's perspective React will feel fast enough).

- It has become the default way for many frontend developers to write JavaScript; I know I am personally guilty of that. This generates a lot of resentment from more experienced developers who have learned to prioritise minimalistic JavaScript bundles over developer experience.

Re: What I wish I knew about React

#163
post #83

I am not so up to date with frontend dev but what's with the hate towards React these days? It still does what it's supposed to do very well and very fast. Yeah sure if you want JSX you need transpilation but I would want that anyway if I want any of the ES6 features without losing browser compatibility. And it's also constantly evolving and getting better. Just recently I started a React project with class component…

I've been coding and training people in react for a while now, and here is my experience: - if you learned react by yourself years ago, you had to go through a lot of pain: the doc was terrible, the ecosystem a moving flaky target and conventions were not established. Things are better today, but it's not something you forget. Somebody starting react in 2018, and with create-react-app, will feel much happier. - if yo…

React native code re-use is possible just not in the way people imagined. You can reuse your Redux code, you can reuse higher order components you just can't reuse the atomic UI elements.

React native performance is good too it just doesn't come for free. You need to know how to do native animations and you need to do late binding and all the other performance optimisations you should be doing with React anyway.

The only thing that lets React Native down is the tooling. I've had the debugger repeatedly push stale code on refreshes, the source mapping is atrocious and sometimes the network debugger just refuses to work. Also sometimes the app fails to load and you need to reload the app and or restart the debugger and or restart the packager in the right order.

Re: What I wish I knew about React

#164

Earlier quoted context omitted.

But what's so hard/bad? Literally zero config and two commands: npm install -g parcel-bundler parcel ./index.html

Those two commands are not just "zero config and two commands", think about the entire stack you're pulling down behind the scenes. Sure, it's easy when you want to render "hello world" but there is so much context and abstraction happening here, that is hidden. Then we haven't even started thinking about HOCs, SSR and lifecycle hooks, none of them addressed by your terminal snippet.

Actually everything is done after this. This is the way I am building a huge SaaS project. Of course it downloads some code, or would you argue that using Javascript is not simple because it needs to run in a browser? Server rendering is trivial to set up with Parcel, but I don't see the point of your remark - you don't have any option of server side rendering with Jquery.

Re: What I wish I knew about React

#165
post #83

I am not so up to date with frontend dev but what's with the hate towards React these days? It still does what it's supposed to do very well and very fast. Yeah sure if you want JSX you need transpilation but I would want that anyway if I want any of the ES6 features without losing browser compatibility. And it's also constantly evolving and getting better. Just recently I started a React project with class component…

> I am not so up to date with frontend dev but what's with the hate towards React these days?

I don't use React day to day in a big team so I can't comment on the maintainability gains, but as a user all I see is websites degrading the experience when migrating to SPA. If state of the art front end engineering with React is Facebook or Reddit then it's hugely disappointing.

Re: What I wish I knew about React

#166
post #83

I am not so up to date with frontend dev but what's with the hate towards React these days? It still does what it's supposed to do very well and very fast. Yeah sure if you want JSX you need transpilation but I would want that anyway if I want any of the ES6 features without losing browser compatibility. And it's also constantly evolving and getting better. Just recently I started a React project with class component…

I love React and write it, in Typescript, on a daily basis. However: - It starts you off with about 40kB of minified gzipped javascript; some developers feel that it's too much. - It is not and probably never will be the most performant framework out there, which upsets quite a few people (although the work that the React core team is doing with Concurrent Mode probably means that from the end user's perspective Reac…

Your last point is a cause of some apprehension for me. In the team I'm currently working with one of my coworkers calls himself a React Developer, and my experience has been that anytime an issue arises that may not be specific to React, this person's ability to problem solve significantly diminishes.

I've seen it in a couple of other individuals as well, and I feel it's becoming more widespread, though I hope I'm wrong. In these instances, I see the framework existing both in the code as well as the mind, and operating outside of it is often a leap too far.

Re: What I wish I knew about React

#167
post #83

I am not so up to date with frontend dev but what's with the hate towards React these days? It still does what it's supposed to do very well and very fast. Yeah sure if you want JSX you need transpilation but I would want that anyway if I want any of the ES6 features without losing browser compatibility. And it's also constantly evolving and getting better. Just recently I started a React project with class component…

Because it's overhyped to the point it's being used everywhere even for projects where there was no reason to ever go beyond basic static HTML + maybe vanilla js, if at all, by devs who want to pad their resume. At the same time, it taxes your mobile battery, and generally leads to a world of overcomplicated appified Chrome-only web sites when actually the web was meant as a straightforward mechanism for self-publishing and exchanging ideas. Finally, reading the umptieth take of a junior dev having his React epiphany, or worse, a staged React consultancy/course ad piece provokes counter-reaction, if only because it's intellectually insulting.

Re: What I wish I knew about React

#168
post #148
post #63

The more I read about React, the happier I am to use VanilaJS alongside SSR and web components friendly frameworks.

You should try to use it too! If you discover you don't like anything about it, all the better, you can say you've experienced it and not just read about it. If you happen to like at least parts of it, you've just expanded your knowledge and arsenal of tools for UI development.

But I have, it just had a different name,

https://www.bitquabit.com/post/the-more-things-change/

https://wiki.haskell.org/Functional_Reactive_Programming

Re: What I wish I knew about React

#169
I write a lot of enterprise apps and I’ve seen many many frameworks come and go over the years.

I personally am not impressed with React and don’t get what all the fuss is about. We’ve had Angular, jQuery and a whole bunch of stuff over the years and each one managed to become a ‘a thing’ for a while

Re: What I wish I knew about React

#170

Earlier quoted context omitted.

I don’t think it’s necessarily success, but novelty. C++ and Java are immensely popular and get nowhere near the vitriol that the thing you mentioned do. Often there’s a number of people on the opposite side cheerleading the thing as well, which underlines the apparent conflict. (Rust is already being complained about, by the way.)

Really? I would have put C++ and Java near the top of the “most ridiculed languages” list.

As the old mantra goes, "there are two types of languages, the ones that everyone complains about, and the ones that nobody uses".
Post reply on HN