title: react.js "this" is a reserved word
body: <p>I have a two fold question.  I am trying to to write a component that checks if the user is on mobile or not, if they are mobile, the state <em>isMobile</em> switches to true (and visa versa if on desktop).  </p>
  
  <p>I have gotten it where I can check for mobile and that works, but getting it to say "true or false" and also conquering the <em>this is a reserved word</em> is stumping me pretty bad.</p>
  
  <p>Any help here is majorly appreciated, here is my code:</p>
  
  <pre><code>//this part will be imported via a component.  Need to check and make sure how to update state via component.
  const checkIfMobile = {
    Android: function() {
      return navigator.userAgent.match(/Android/i);
    },
    BlackBerry: function() {
      return navigator.userAgent.match(/BlackBerry/i);
    },
    iOS: function() {
      return navigator.userAgent.match(/iPhone|iPad|iPod/i);
    },
    Opera: function() {
      return navigator.userAgent.match(/Opera Mini/i);
    },
    Windows: function() {
      return navigator.userAgent.match(/IEMobile/i);
    },
    any: function() {
      return (
        checkIfMobile.Android() ||
        checkIfMobile.BlackBerry() ||
        checkIfMobile.iOS() ||
        checkIfMobile.Opera() ||
        checkIfMobile.Windows()
      );
    }
  };
  
  //testing out a function to a get a boolean (true or false)
  const trueOrFalse = () =&gt; {
    console.log('hi', checkIfMobile);
  };
  
  export default class App extends Component {
    constructor() {
      super();
      //the state "isMobile" would update the boolean changing the test when user is using mobile device
      state = { isMobile: true };
    }
    render() {
      //an if/else statement to see if it will detect mobile.  It does however I have the problem of "this is a reserved word"
      if (checkIfMobile.any()) {
        console.log("it's mobile");
      } else {
        trueOrFalse();
      }
  
      const isMobile = { this.state.isMobile };
  
      return (
        &lt;div&gt;
          &lt;ChromePluginNotice /&gt;
  
          &lt;Banner isMobile={isMobile} /&gt;
          &lt;Content isMobile={isMobile} /&gt;
          &lt;Footer /&gt;
        &lt;/div&gt;
      );
    }
  }
  </code></pre>
  
  <p>thank you in advance for your help</p>