Principles of React
Before we start learning how to set up a React project, let’s revisit the three fundamental principles of React. These principles allow us to easily write scalable web applications.
React is based on three fundamental principles:
- Declarative: Instead of telling React how to do things, we tell it what we want it to do. For example, if we change data, we don’t need to tell React which components need to be re-rendered. That would be complex and error-prone. Instead, we just tell React that data has changed and all components using this data will be efficiently updated and re-rendered for us. React takes care of the details so that we can focus on the tasks at hand to easily develop our web application.
- Component-based: React encapsulates components that manage their own state and views and then allows us to compose them in order to create complex user interfaces.
- Learn once, write anywhere: React does not make assumptions...