Over the weekend, I put together a quick app using React.js. I’ve gotta say I was really impressed. It’s the first front-end framework I’ve used that has seemed to hit the sweet spot in terms of complexity and clarity.
The app is utterly simple so I hesitate to even label this a “project”, but nonetheless it had enough complexity that it produced a couple challenges along the way. You can check it out over here.
Functional: React encourages you to code in a functional style, which will increase code quality by diminishing side effects. ‘Nuff said.
State: React removes a lot of the burden of state management that you encounter with minimal frameworks like Backbone. Instead, it uses a simple object life cycle model that automatically updates the UI when the state changes via these life cycle events. This removes the need for event mediator patterns that are common in Backbone for simple component updates, while not resorting to two-way data binding via dirty checking in something like Angular. I would say that 2⁄3 of my time as a front-end developer was devoted to tracking down messy state bugs when I used Backbone. I didn’t encounter one case with React where I was confused about what the state of the component was.
Learning Curve: The React learning curve seemed to be pretty gentle and from what I gather the framework is very extensible. This is in contrast to the cliff that must be climbed with Angular, where you have to know quite a bit to even start getting something on the screen. After climbing that cliff, I’ll admit things seem pretty magical, but quickly become annoying when the way you are thinking about how the logic of you application should be organized doesn’t follow the Angular way.
Reusability: Lastly, React encourages the construction of modular, reusable components. This makes sense since it was developed at Facebook, where a team might own a widget and not an entire app. In any case, it allows it to be used in cases where you only need dynamic content for one widget on an otherwise static page (or site). However, React-router makes it really easy to extend these widgets to create a full single-page web application
!importantsuffixes in you stylesheet.
Overall, this is the first front end framework, that I really enjoyed using and didn’t feel like I was battling the entire way. I’m sold (at least until Elm matures)…