Questions
To recap what we have learned in this chapter, try to answer the following questions:
- What are React’s three fundamental principles?
- What are the two types of components in React?
- What are the problems with class components in React?
- What is the problem when using higher-order components in React?
- Which tool can we use to set up a React project, and what is the command that we need to run to use it?
- What do we need to do if we get the following error with class components:
Uncaught TypeError: Cannot read properties of undefined (reading 'setState')
? - How do we use React state with Hooks?
- What are the advantages of using function components with Hooks, in comparison to class components?
- Do we need to replace all class components with function components using Hooks when updating React?