Live data from Hacker News

My struggle to learn React

bradfrost.com

111–120 of 218 posts

Re: My struggle to learn React

#112

I found React one of the easiest frameworks to learn and pick up but I had the benefit of learning React after working for a few years with Backbone and Angular. I found the opinions of the framework to be sensical and guided by the realities of web application development and developer experience. > 1. i haven’t invested enough time on learning it. I usually find the types of tutorials Brad references in this sectio…

> I think React could benefit from a clearer breakdown of how JSX translates to actual JavaScript.

I think a key factor here is that JSX is JavaScript but it pretends to be HTML. Things like `className` vs. `class` aren't insurmountable but it seems to be a common source of confusion until people have internalized that divide.

Re: My struggle to learn React

#113

I've been doing web development for over 15 years, and I've seen a lot of trendy web application / UI frameworks that are going to be the The Final Paradigm come and go. That experience has taught me an important lesson about trendy framework stuff: If it doesn't make sense to a lot of people after a lot of thought, and there's a lot of rationalization required to plug that gap, it's probably not working out very wel…

Honestly, something like React/Vue has got to be as close as it gets to "The Final Paradigm". At this point, it's been a long time since I've seen a new paradigm that does anything vastly different or more productive and simple than JSX + React/Vue lifecycle & state hooks. Most of the new UI libs that come out (Glimmer, Marko, etc) seem to be heavily influenced by React and don't offer a giant leap in how UI is done.

I think there's plenty of more opportunities in state management, CSS management, application structure, tooling, and making those more simple, but generally I think the view layer is more or less solved.

Re: My struggle to learn React

#114

I've been doing web development for over 15 years, and I've seen a lot of trendy web application / UI frameworks that are going to be the The Final Paradigm come and go. That experience has taught me an important lesson about trendy framework stuff: If it doesn't make sense to a lot of people after a lot of thought, and there's a lot of rationalization required to plug that gap, it's probably not working out very wel…

I haven't found a JavaScript framework that truly makes things easy. I've been a developer for a long time, going back even before the web itself, and a lot of the older technology was pretty easy in comparison to what we have today for web development.

My impression of React is actually quite positive; it solves a real problem in a highly performant way and with a relatively good model. But it is still pretty low-level to me; even if you add in a dozen or so other libraries.

My needs are fairly different from Facebook or most startups -- I don't work on a single highly optimized application -- I build a new application every few months (and maintain all of the previous ones). The current set of JS frameworks don't do a lot to help me.

Re: My struggle to learn React

#115

I found React one of the easiest frameworks to learn and pick up but I had the benefit of learning React after working for a few years with Backbone and Angular. I found the opinions of the framework to be sensical and guided by the realities of web application development and developer experience. > 1. i haven’t invested enough time on learning it. I usually find the types of tutorials Brad references in this sectio…

I don't think so...

   ...
   function doSomeJsStuff() { ... }
vs

    function MyButton(props) {
      return 
        {props.children}
      
    }
The latter is a reusable component, the former is a one-off that has to be repeated over and over instead of re-used. Both wrap one syntax into another.

Re: My struggle to learn React

#116

Earlier quoted context omitted.

This question is so wrong on so many levels

I have a blog. It's a set of static pages, generated offline and served via Nginx. There's nothing dynamic there and the content is perfectly readable in lynx. Once in a blue moon, I want to add a screenshot or other image to a post. Such images are of various sizes, mostly larger than the (max)width of the content. I use CSS to scale them down to fit with the text, but sometimes images displayed like that are too ti…

The choice of tooling has to be dictated by actually delivering a product, even if it's open source. If JQuery met your needs at the time, and your personal preferences and experience are nonfunctional requirements, it was the right call. That doesn't mean that in the future you won't grow beyond that, but having to transition a production system to a new technology is fundamentally a good problem to have.

Re: My struggle to learn React

#117
post #73

Earlier quoted context omitted.

React Router v4 is particularly difficult to get used to when compared to earlier versions. While I don't much mind it (I get it working, then I don't need to touch it anymore), it definitely took me some time to wrap my head around it. So yeah, it works good when you get it working, so yeah, the best thing to do is to just buck up and learn if it you need it. But boy does it suck getting there. All of that said, I d…

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.

Re: My struggle to learn React

#118
post #99

Earlier quoted context omitted.

I mean this in a nice way, I'd really appreciate a gist showing how you get the core concept of react-router in 50 lines. It's in a project of mine now and maybe it shouldn't be.

You have a top-level component whose render function retrieves the current URL, checks it against a bunch of regexes, and based on that decides which "page" to actually render. The regexes capture "parameters" in the URL with capture groups, and they're passed as props. You also have a few (single-digit) lines of code to wire up the history API so that the back button works. You have a tiny helper function that uses…

With respect to Flux/Redux, the Facebook team even stressed when they originally released Flux that it should be used sparingly. It is useful in some circumstances, particularly that which it was originally designed for, but it seems in my experience that it often used, unnecessarily, as a stand in for a controller (in MVC terms) layer.

When React was originally released it was sold only as a view layer that you plug into your application stack. Since no official way of approaching the rest of the stack emerged from Facebook, when Flux was announced it seems that it was taken as the rest of the stack by many.

Re: My struggle to learn React

#119

I had the complete opposite experience... I've managed to stay fairly current with JS all along from ES5 through the influence of babel and other tooling towards ES6 and now. When I first started playing with React, I felt "finally!" I had worked with .Net (both VB and C#) in the past as well as with ActionScript (Flex and Flash) and working with EcmaScript for XML (E4X) combined with XML literals in VB.Net was very…

There's also mobx which imo is even better.

mobx just feels dirty to me, kind of like ngrx instead of angular-redux on the angular side... I like the cleaner feel of a state reducer in redux.

Re: My struggle to learn React

#120
post #8

He didn't even get to the part that I find confusing; the naming of things. componentDidMount? componentWillMount? Wtf is mounting? This isn't a goddamn harddrive. Props? Do you mean properties? or arguments? Wtf is a prop? Reconciliation? Portals? The fuck? And then, to top it all off, you can't just use React , you need to pair it with a set of other libraries, each with their own set of ridiculous jargon and parad…

Nah, it solved huge problems in UI for complex projects. One-way data flow, functional component abstraction, virtual DOM, simple & minimal API (11 methods). It encourages componentization in a way that no other framework quite does as nicely. Because the components are one-way, it's trivial to break up a component that has gotten "too big". I mean, a simple react component is:

const HelloPerson = ({ person }) => Hello, {person};

ReactDOM.render(, document.getElementById("root"));

That's elegant as fuck.

Post reply on HN