React.js: A Designer’s Perspective
Although many people shared my initial reservations, React has gained traction quickly, likely because of the following key features:
- React.js is a library, rather than a framework, so it plays well with others., You can pair it with other frameworks such as Angular or Backbone (as my colleague Kevin Kazmierczak has previously mentioned).
- It’s fast by default, allowing you to describe what the view should render without needing to worry about how to update the DOM to get there. It does this without requiring magical 2-way bindings. This is accomplished by only updating the parts of the view that change, instead of re-rendering the entire content, or using dirty-checking as is seen in some frameworks.
- It promotes component-oriented development. This leads to better isolation of code and styles, and simplifies code reuse.
Since I am a designer first and developer second, I have a different set of criteria when evaluating a framework. When I’m building prototypes, I need tools that allow me to quickly emulate basic interactions and manipulate non-persistent data. I also need the code to be flexible enough that I can adjust styles and labels without worrying about breaking the entire system’s layout.
Having become more familiar with React, I’ve realized it has been able to solve the following problems I’ve run into with other frameworks in the past:
- When you don’t use components, everything can get complicated, very quickly.
- When you have a large code base, CSS will get away from you.
- Performance slows down for reasons ranging from to much data being bound in a view, to using the wrong tool for the wrong job.
To encourage designers and developers to avoid creating this code-bloat, many solutions exist and are used (like Angular Directives and SMACSS), but they require a good bit of discipline to implement.
At Universal Mind, we endeavor to choose the best tools for each project, and we’re very excited about React’s potential for interactive prototypes and production applications. We even have people contributing to the React community. I look forward to watching React’s popularity grow, other alternatives emerge (as they always do) and seeing how other designers feel about its more controversial aspects (i.e. JSX and inline CSS) and its applicability to their own prototyping work.