IPAddress from React book component only works w/ "on your network"

Hi everyone - I just posted a workaround here: Chapter 14 too many requests error

In short, you can sign-up for a free account at ipinfo.io and use the token as part of making the request. The other option is to just use my free token instead: https://ipinfo.io/json?token=2277ce4bac0347

  componentDidMount() {
    xhr = new XMLHttpRequest();
    xhr.open("GET", "ipinfo.io/json?token=2277ce4bac0347", true);
    xhr.send();
 
    xhr.addEventListener("readystatechange", this.processRequest, false);
  }

The only risk with using my token is that there is a slight chance that many of you might be using it daily and that the request limit might get reached :slight_smile:

1 Like