React is a Javascript framework which lets you write interactive UIs in a declarative way. It lets you design views to represent the state in your application, and it will update and render the right components following changes in the data. The code, however, is much verbose than other frameworks such as Angular. This is based on the asusmption that code is read much more often than writen, therefore, they prefer this approach instead of a more concise one.
When working with React, a good approach is to start thinking about components from a User Experience point of view, start writing the most basic ones, and then write more complex one making use of thouse in order to build more complex UIs.
Components can be written in an XML-like syntax called JSX, which lets you mix Javascript to write the component logic and HTML to define the layout, as each component will have to know how to render itself on-screen. This means that everything related to a component will sit together. You don't necessarily need to use it, but you are strongly encouraged to, as it'll make your live much easier.
It is possible to use React in conjunction with pretty much any technology stack, as it doesn't make any assumption about this matter. It is even possible to integrate it, more or less painfully, into a Maven build.
To learn more, the best resource is Facebook's website for React, React. There is a pretty straightforward tutorial, and you are invited to take a look at my playground on my Github.
If you take a look at both the React tutorial and at my playground, you'll notice that mine is a simplified one based upon the first. The tutorial is about building a comment list, along with a form which lets you add more comments, and it comes with a simple backend as well.
My playground, on the other hand, is a list of transactions, with a form which lets you add more transactions, therefore altering the balance of the account accordingly. No backend, just a small proof of concept for React.
Bogdan Utanu
Tags: react, javascript
September 1st 2016