Why React?
In the previous chapter, we manually rendered the user interface using Document Object Model (DOM) operations to generate HTML code with JavaScript. As you can imagine, it would be quite painful to have to manually do DOM operations to build your entire user interface. This is where React comes in. From React's official documentation: React - A JavaScript library for building user interfaces.
React takes a new approach to building user interfaces, by making use of functional programming principles—similarly to Redux!
The principles of React
Similarly to Redux, React also comes with a set of principles, as follows:
- Declarative: This means you write code of what you want and do not have to think about how to do it.
- Component-based: You can split your application into multiple modules and combine them to build complex user interfaces.
- Learn once, write anywhere: React is a library, not a framework. It is independent of your stack and you can use it in the browser, on the server, or even...