loading...

From Angular to React

wolfhoundjesse profile image Jesse M. Holmes ・1 min read

I've spent the past three years growing up with Angular and TypeScript. I've never worked with a language that saw so many changes in a year, from adding additional types to changing the way we think about type inference. As difficult as it was to keep up at times, we eventually became one.

Now that my career is on the move, I've been exploring React. I jumped right in with a few projects built on create-react-app, and I noticed two thigs right away.

First, I have a decent handle on ES6/7, and I can thank TypeScript for that. In fact, the last time I used JavaScript for any length of time was … before jQuery hit the scene, so I've never even used lodash or underscore.js. Let's just keep that bit between us!

Second, types are awesome. That is all. React's PropTypes can fill that gap, and I'm sure there is a tool for my favorite editor that will help straighten things out if I start mismatching types.

I've been having a blast with React. Excuse my terrible analogy, but the more time I spend with it, the Angular feels like piloting a 747 (don't they land themselves these days?), and React feels like taking a motorcycle on a windy back road. They're both capable vehicles, but connection between man and machine feels a lot stronger without the huge framework in the way.

What was your experience if you traveled in this direction? What are some pitfalls to developing React apps with TypeScript?

Posted on by:

wolfhoundjesse profile

Jesse M. Holmes

@wolfhoundjesse

⛡️ Building ambulatory healthcare software in beautiful, historic Annapolis, Maryland. Brass-bander. ADHD Avenger. Lover of giant hounds. Believer in the impossible.

Discussion

pic
Editor guide
 

I migrated from Angular to React last year. Feels different, when everything was provided with Angular, I feel like having too much freedom with React (and too much choice in the libraries). On the other hand, the event loops seem easier to understand with React.

I am now using React+Redux+TypeScript on the projects I make. TypeScript seemed to be quite bleeding edge with React but things seems fine now though. Putting types everywhere helps me to keep control of what I am doing and avoid dumb errors.

 

I feel like having too much freedom with React (and too much choice in the libraries)

Was that intended to be a bad thing? It sounds like you are stating a preference.

 

I'm more of a back-end Java developer but the problem with too much choice is having to research everything every time you want to do something to make sure it's the best. Not necessarily a bad problem but it can slow things down as opposed to there being One True Way to do something.

 

It seems nice, but you have to compare the libraries to find the "good" one, that eats too much time

 

I also started with Angular a little before it changed to Angular 2 and then kept changing. For me it was not natural at all and I felt doing things in a language I couldn't understand (wasn't mad about TypeScript tho).

This year I started dabbling into React and then took a deep dive with a Bootcamp I took, but this time it felt different. It felt more straight forward and since I got a liking for ES6, making things with React felt more comfortable.

The PropTypes and defaultProps are for sure something really neat that I haven't seen before so yeah, I'm enjoying quite my time doing things with React like I haven't done before with anything else.