In this section of the page, two of the sample codes are missing a blank line between the block of import statements and the following code block. This inconsistency affects readability and contrasts with other examples where a blank line is included.
Most sample codes in the React documentation include a blank line between the import statements and the following code block. However, in this section, the two sample codes do not include this blank line. To maintain consistency and improve readability, it would be beneficial to add the missing blank lines. This practice is commonly recommended in many style guides and projects to enhance code clarity and maintainability.
Summary
In this section of the page, two of the sample codes are missing a blank line between the block of import statements and the following code block. This inconsistency affects readability and contrasts with other examples where a blank line is included.
Page
https://react.dev/learn/updating-objects-in-state#treat-state-as-read-only
Details
Most sample codes in the React documentation include a blank line between the import statements and the following code block. However, in this section, the two sample codes do not include this blank line. To maintain consistency and improve readability, it would be beneficial to add the missing blank lines. This practice is commonly recommended in many style guides and projects to enhance code clarity and maintainability.