Entering React after learning JavaScript

A brief introduction to React, its benefits, and why it would help you to learn JavaScript before learning React.

Why learn React?

Innovation

React can be integrated seamlessly with any other library or framework because React is a view only library, (it is the view part of the Model View Controler MVC architectural UI pattern). The freedom to use any other framework and library makes it possible to experiment and so to innovate.

Simple API

React has a relatively simple API and so has no steep learning curve. It only has a handful of methods to understand. The code to make ‘components’ of the UI (i.e., buttons etc) is straight-forward as there is very little boilerplate code which makes the library comparatively accessible.

JavaScript

JavaScript is arguably the world’s most popular programming language and is also incredibly powerful. JavaScript is both a functional and an object-oriented programming language and so harnesses the advantages brought by both paradigms. React is in JavaScript and so inherits its benefits.

ES6

ES6 refers to version 6 of the ECMA Script programming language. ECMA Script is the standardized name for JavaScript, and version 6 is the next version after version 5, which was released in 2011. It is a major enhancement to the JavaScript language, and adds many more features intended to make large-scale software development easier.” You can read more for the details of the new features that ES6 introduces.

JSX

JSX stands for Javascript Syntax Extension. It allows you to use HTML and XML in JavaScript. Essentially, the HTML/XML code is ‘transpiled’ into JavaScript. In other words, the HTML/XML is converted into JavaScript before the code is compiled. This enables the full power of JavaScript to be employed with the relative ease of writing in HTML.

Unidirectional Data Flow

React implements one-way data flow which makes it easy to reason about your app. Essentially all the parts of the UI are contained within each other which makes tracing data flow super simple.

Community

React is a very popular and growing library. This means that the React community is large and growing too. So there are a plethora of resources out there to help you as you learn. Essentially, you won’t get ‘stuck’ anywhere for extended periods of time as someone will have had the same problem as you before and is likely to have posted about it online.

Why bother learning JavaScript? Why not dive straight into React?

While it is possible to learn React without any knowledge of JavaScript, it won’t be easy. Frequent run-ins with language specific issues would become roadblocks. If you know JavaScript well, on the other hand, your React journey will be smooth, and the focus would be on utilizing the functionalities of React itself. In the next lesson, we will have a look at the skeleton code that the create-react-app provides and what JavaScript​ concepts can help.