With any programming language, framework, or library that you use, there are always common tactics that you should follow. They present an understandable, efficient way to write applications.
In Chapter 4, Integrating React into the Back end with Apollo, we tackled some patterns, such as rendering arrays, the spread operator, destructuring objects, and higher-order components. Nevertheless, there are some further patterns that you should know about.
We will go over the most commonly used patterns that React offers, as follows:
- Controlled components
- Stateless functions
- Conditional rendering
- Rendering children
Many (but not all) of the examples here only represent illustrations of what each method looks like. Some of them will not be taken over to our real application code, so, if you are not interested in learning the essential aspects of patterns,...