stop useEffect react hook re-render multiple times with async call - tutorial - useEffect cleanup.

Опубликовано: 23 Июль 2021
на канале: Dylan Albertazzi
42,496
717

Today we go through a quick trick on how to stop unwanted responses from re-rendering a react component whose useEffect has an async function.

TL;DR Use useEffect cleanup. See the code here 👉 https://gist.github.com/dylan-alberta...


I ran across this problem when making an API call when a component re-rendered.

---

📈 Ready to Scale Your Revenue? Lighthouse is my complete digital marketing solution focused on what matters most: helping your law firm grow by increasing revenue, not just leads.

Check us out at: https://www.lighthousedigital.us/