Live data from Hacker News

My struggle to learn React

bradfrost.com

131–140 of 218 posts

Re: My struggle to learn React

#131
post #46

I don't get what the benefit of using React is, aside from having it on my resume. A virtual DOM? What does that get me? It renders faster? Rendering speed is not a problem my CRUD screens have. Etc., etc. Perhaps some UIs are so complex and dynamic that they're easier to build and maintain using React. I'm not saying other people shouldn't use React, but I'm fairly certain it wouldn't give me enough payback to justi…

> I don't get what the benefit of using React is It's frontend technology that is robust enough to deliver Facebook. If you haven't worked on or aren't working on a complex UI with a team of developers, you might not appreciate how incredibly solid React is. This isn't something that can be explained well through anecdotes, but this comment is getting at it: > Its top down `(props) => rendered view` paradigm is a bre…

Actually, I find the DOM surprisingly structured for reading and manipulation. This button have one or more events? No problem! Want to see the code in that event, no problem. The DOM is the truth, and you are free to read, understand and modify it as you like.

What is a problem though, is that there is no consensus in the team about how the code should be structured. So everyone creates their own mess.

Oh state management? There is something called observer pattern for that.

Re: My struggle to learn React

#132

Honestly I don't know how I learned React. It's not fun at all. Oh sure, the basics of React is not too hard. If you ignore all the outdated examples and code (using var, no JSX, overusing component lifecycle, not using functional components). But then learning Redux, React Router, React JSS, Reselect, Redux Thunk, Webpack, etc., is just terrible. Sure, there are tutorials for each individual library, or maybe even t…

I feel similar to both OP and you; especially when first learning React a year ago. I feel like the only real way to learn it is to get a job where you work with React full time, and after a few months you will finally get comfortable with it. (that's how I learned it) I was fortunate enough; when shutting down my startup a year ago and needing to land a new job, a team of coworkers I used to work with took me in without much of an interview, so I was hired into a React shop even with zero React experience. I can imagine the predicament when you have no React experience, and also can't get a React job to learn it.

Re: My struggle to learn React

#133
I think this person needs to think in terms of a series of onboarding ramps. You aren't going to learn to fly a commercial jet from nothing. You might want to get a private license first. Before that you learned to walk, talk, read, write and add up.

In other words, learn JS proficiently without any libraries first.

Then learn basic react, maybe without all the complex toolchains - just include the CDN link that compiles the code on the page and grok React.

Then finally do some basic React coding without the Redux etc.

Re: My struggle to learn React

#134

Honestly I don't know how I learned React. It's not fun at all. Oh sure, the basics of React is not too hard. If you ignore all the outdated examples and code (using var, no JSX, overusing component lifecycle, not using functional components). But then learning Redux, React Router, React JSS, Reselect, Redux Thunk, Webpack, etc., is just terrible. Sure, there are tutorials for each individual library, or maybe even t…

I've written a react and a react-redux tutorial that, although are a little old, I believe that teach most important topics: https://spapas.github.io/2015/06/05/comprehensive-react-flux... and https://spapas.github.io/2016/03/02/react-redux-tutorial/

Re: My struggle to learn React

#136
post #106

Earlier quoted context omitted.

Sometimes react ecosystem and all the dependencies feel way too much. Sometimes all I want is to use data bindings, and at those times I just ended up using Vue.

Same here, but in my case when I need that I usually go with Mithril.js[1]. I found it by chance and instantly liked it. It's a shame that nobody seems to know it. [1]: https://mithril.js.org/

The framework usage is still growing, though it is dwarfed in popularity even by Vue (which is ~60 as large). We do little to promote it, and hyperscript (the default view syntax, i.e.

    m('.foo', {...attrs}, ...children)
) is not very popular (even though I prefer it to JSX, which is also supported).

Re: My struggle to learn React

#137

Honestly I don't know how I learned React. It's not fun at all. Oh sure, the basics of React is not too hard. If you ignore all the outdated examples and code (using var, no JSX, overusing component lifecycle, not using functional components). But then learning Redux, React Router, React JSS, Reselect, Redux Thunk, Webpack, etc., is just terrible. Sure, there are tutorials for each individual library, or maybe even t…

>> But the point would be to start with the basics and build up an understanding of why we need these libraries. And what problems they solve and what problems they don't solve. This is exactly what the well-written official React docs do. It doesn't involve any CSS-in-JS, Redux, Thunking, Webpack, etc. 1) Start off with a basic app - build the Tic-Tac-Toe app through the official React docs 2) Build a simple React a…

Yeah, I guess I'm not giving the documentation enough credit here. The main issue I see is all the companies rewriting their applications in React. Because I don't think they see it as a complicated engineering decision with tradeoffs and potential issues. They see it as "we need x buzzword and y buzzword". I'd prefer that the documentation outright say "This is a BAD idea if you're just doing xyz" instead of "if you need, you can check out this". Because it's very easy for developers, especially magpie developers or younger developers to think "oh yeah, of course I need this. I need my app to be S C A L E Able". The idea behind the tutorial would be giving precise problems that are solved by the tools, while also demonstrating what can be accomplished without them.

Also, is it just me or is the tic tac toe tutorial really not useful? Sure, it's a good isolated example, but it's a really contrived one as well. Something like an address book or a blog would be a lot more fitting with people's usecases.

Re: My struggle to learn React

#138
post #54

Earlier quoted context omitted.

I found react to be extremely intuitive and easy to learn. Redux and react-redux are horribly non-intuitive. So much boilerplate and meaningless terminology and stringly-typed objects. I avoid it.

React is just mapping data to XML, which may or may not end up as XML (React DOM vs. React Native). Throw in a component lifecycle, and you're good to go. Sure, it's not jQuery simple but for a modern SPA it's about as good as it gets. It allows you to just deal with things in terms of composed functions which is wicked elegant, and since you're almost surely thinking of your page and application hierarchically it ma…

> React is just mapping data to XML

Nit: It maps it to a virtual DOM, not XML.

Re: My struggle to learn React

#139
A lot of this is nothing to do with React, which is a library for mapping state to virtual DOM, and using virtual DOM nodes to update a real DOM.

If you can’t read the ES6 syntax, transpile it. Use the Babel REPL. Throwing up your hands feels good for a minute but it won’t actually help with anything. If too many concepts at one time is overwhelming, narrow it down. None of this stuff is magic. Take some breaths.

Re: My struggle to learn React

#140

Earlier quoted context omitted.

Partly, the fact that React-Router has upgraded so many times in divergent ways in a short amount of time has left many folks with a bad taste in their mouth. If the router was just "Buck up, learn it, and you're golden" I suspect we wouldn't hear too much hollering about it. Unfortunately, the hassle of using it is so close to clockwork I feel like I should just schedule a week every six months or so for maintenance…

What's the win to keeping up with it? Am I wrong that the problem it's solving is really pretty simple? I had the same problem with react-bootstrap, which I used for about a year and ran into regular upgrade compat problems. I wouldn't mind that much except that wrapping a React component around a fragment of HTML is not a problem so difficult that I'd endure compat problems in a dep to solve it.

> What's the win to keeping up with it?

With the router, it was never a matter of us just deciding to upgrade for the sake of upgrading but rather ending up being painted in a corner with peer dependencies requiring upgrade. Additionally, because we were a micro service / many SPA outfit, we ended up with a dozen or more applications at varying levels of libraries so you had to deal with 2.x, 3.x, and 4.x or just upgrade.

For those of you reading along thinking "This sounds like a dysfunctional environment!" You're right! Imagine having five heads of department, albeit two interim, in a year.

> I had the same problem with react-bootstrap, which I used for about a year and ran into regular upgrade compat problems.

I'm in the middle of building out an internal component library based on `react-bootstrap`, so that's fun to hear...

Have your issues mostly been upgrades of the library? Or of Bootstrap versions? We internally decided we're just sticking with Bootstrap 3 for the foreseeable future with the hope that it will mean we don't have many issues to deal with.

Post reply on HN