8. Handling Side Effects

Learning Objectives

By the end of this chapter, you will be able to do the following:

– Identify side effects in your React apps.

– Understand and use the useEffect() Hook.

– Utilize the different features and concepts related to the useEffect() Hook to avoid bugs and optimize your code.

– Handle side effects related and unrelated to state changes.

Introduction

While all React examples previously covered in this book have been relatively straightforward, and many key React concepts were introduced, it is unlikely that many real apps could be built with those concepts alone.

Most real apps that you will build as a React developer also need to send HTTP requests, access the browser storage and log analytics data, ...

Get React Key Concepts now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.