My First Impressions on React

I have been playing around React in the last three nights and I am impressed. Web development has changed significantly in the past decade, it is still HTML + JavaScript, but frameworks like Angular and React make creating interactive UIs much easier – when you understand how it works, and the code is easy to share & maintain, not to mention mobile friendly.

My strong suits are still on the back-end development, but I have been learning Angular since my team adopted it early this year. There are times I struggled with certain concepts in those frameworks, but there are more I enjoyed seeing a web app live and interactive. That being said, I am still new to these popular frameworks and I am still learning.

Here are my first impressions.

  • Components and reusability. React encourages us to break down UI elements into reusable component, and each component can be easily developed and referenced in other components.
  • State attribute. Component can have state attributes, which are easy to set, change, and pass to child component. Child component can have call back to change parent’s state as well. Very cool.
  • Event handling. Event handling is straightforward in React, and all the functions are automatically bound to the Component where they are defined.
  • Bootstrap! React-Bootstrap exists!
  • JSX. JSX embeds HTML and JavaScript together in one file. I started to like this concept because one JSX component file is all you need to define the behavior for this UI element. No lengthy HTML or JavaScript files. It is easy to maintain too. Some small gotchas include different identifier names, e.g. use “className” rather than “class”.
  • It is not MVC. It is all about reusable UI component that owns its display logic.
  • It works with Meteor! This is a huge plus for me and it simply replaces Blaze. Another benefit of using Meteor is that it makes me to define business logic in Meteor’s JavaScripts, not React’s. React will only host display logic that renders the view.

You can read more why Facebook built React here.

In the next post, I will show you how to build a Single Page App (SPA) by using Meteor, MongoDB, and React.

Happy coding everyone!