---
title: "Comment by Nicholas Stephan on \"5 best libraries for making AJAX calls in React\" | Hashnode"
description: "Great list of ajax libraries! But if you&#39;re talking about ReactJS specifically, then every one of your examples is, in facebook&#39;s own words, an anti-pat"
url: "https://hashnode.com/posts/5-best-libraries-for-making-ajax-calls-in-react/57bd9cec93309a25047c5f66/comment/587296229576d582d21dd4d5"
---

[Discussion](https://hashnode.com/posts/5-best-libraries-for-making-ajax-calls-in-react/57bd9cec93309a25047c5f66)

Comment [5 best libraries for making AJAX calls in React](https://hashnode.com/posts/5-best-libraries-for-making-ajax-calls-in-react/57bd9cec93309a25047c5f66)

[Nicholas Stephan](https://hashnode.com/@nicholasstephan)

[Jan 8, 2017](https://hashnode.com/posts/5-best-libraries-for-making-ajax-calls-in-react/57bd9cec93309a25047c5f66/comment/587296229576d582d21dd4d5)

Great list of ajax libraries!

But if you're talking about ReactJS specifically, then every one of your examples is, in facebook's own words, an anti-pattern. You're setting state in an asynchronous callback, which means the component could be unmounted by the time the callback is called.

@fibric gets it; calling out qwest's cancellable promises. I'd recommend everyone read this post on React's blog: [facebook.github.io/react/blog/2015/12/16/ismounte…](https://facebook.github.io/react/blog/2015/12/16/ismounted-antipattern.html)

[Harshit Mehrotra](https://hashnode.com/@supra28)

[Feb 11, 2017](https://hashnode.com/posts/5-best-libraries-for-making-ajax-calls-in-react/57bd9cec93309a25047c5f66/comment/587296229576d582d21dd4d5#reply-589ecd8b5b2e45fefa52b96f)

You can use axios to cancel requests, [https://github.com/mzabriskie/axios#cancellation](https://github.com/mzabriskie/axios#cancellation)
