Getting Started With React.js

Here's a thing I made with React.js!

I’ve spent the last 6 weeks rebuilding the Crossfader website in React.js (nb: the new version isn’t live as of me writing this…), as well using it to build a couple of small things in my free time. I wanted to write down my thoughts on the framework now, and see how they compare after I’ve been using it for a few more months.

One thing I should say before diving in, is that I’ve been doing exclusively backend development since the end of 2013. These past few weeks have been my first baby steps back into the world of client-side development. It’s weird, but I don’t hate it as much as I used to.

The Good

  1. It’s really easy to do the “simple” stuff with React. Which is to say, I’ve been able to do things like keep a real-time count of the number of characters in a text field in like 3 lines of javascript. No need for jQuery or any weird hacks like I remember.
  2. There is actual support for writing and running tests, thanks to jest.js. Ruby makes test-first programming a no brainer, and as a result, I’m skeptical of any code that doesn’t have tests. Things have come a long way on that front, and React makes it only a little painful to write tests, which I love.
  3. Most React.js components that I’ve written are actually reusable. The pass-props-to-children approach makes for easy to reason about components, that aren’t very hard to generalize out for use in other places.

The Not So Good

  1. I’m still not as productive with Javascript as I am with Ruby, so it’s been a frustrating few weeks having to refer to the docs constantly as I learn the new APIs. I’m hoping I’ve already encountered all the libraries I’m going to need on a day to day basis, and won’t have to spend much more time getting up to speed.
  2. Some parts of the Javascript/Node.js stack feel too magical for my taste. Though this isn’t a problem with React directly, watching npm install several dozen dependent packages every time I install something makes me uneasy.

Overall, I’m happy with what I’ve been able to accomplish with React so far. It’s definitely a step in the right direction as far as front end UI frameworks go.