Summary
In this first chapter of the book, we started by learning about the fundamental principles of React, and which types of components it provides. We then moved on to learn about common problems with class components, using existing features of React, and how they break the fundamental principles. Next, we implemented a simple application using class components and function components with Hooks, in order to be able to compare the differences between the two solutions. As we found out, function components with Hooks are a much better fit for React’s fundamental principles; they do not suffer from the same problems as class components, and they make our code much more concise and easy to understand! The React team now even recommends using function components instead of class components, making function components the state-of-the-art way to write React code. After reading this chapter, the basics of React and React Hooks are clear. We can now move on to learn about Hooks...