DEV Community

Discussion on: Best Practices for React Developers in 2021

Collapse
 
eyalshalev profile image
Eyal Shalev

In your component separation example, I would have used an AbortController instead of the active flag.
That way you can abort the fetch if the component is unmounted.