Errata

React: Up & Running

Errata for React: Up & Running

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Lifecycle Example: Using a Child Component - section
chapter 2

In chapter 2, section - Lifecycle Example: Using a Child Component

First, let’s isolate the lifestyle logging into a separate class and have the two components inherit it. Inheritance is almost never warranted when it comes to React because for UI work, composition is preferable, and for non-UI work, a regular JavaScript module would do. Still, it’s useful to know how it works, and it helps you to avoid copy-pasting the logging methods.

Comments:
In the above paragraph, lifestyle logging should be lifecycle logging.

Arun T  May 17, 2022 
useLayoutEffect
4th paragraph in code block

Hi,

I have found that the example being used to showcase useLayoutEffect is not correct as it is not following the rule of hooks. If you visit React.js documentation, it is clearly mentioned that hooks cannot be inside conditions or loops. In addition to that, Hooks should be used at the top level but the author has used it inside the condition which is quite annoying to see such a mistake and is certainly not convincing me to read further.

I hope to see the mistakes corrected so that readers would not be making the same mistakes.

Thanks

Ankit Sharma  Apr 21, 2023