title: Why can I console.log the value but not setState?
body: <p>I apologize in advance if there is a super obvious solution but I'm very new to React.js.</p>
  
  <p>I'm working with the google-translate api to build a simple translator component.The text input is stored in the state and used by translateInput(), I then want to set the state with the translated text. Unfortunately, I can't, I can however console.log the value which is returned by the googleTranslate function. Why is this happening? Do I have to bind the callback function somehow?</p>
  
  <p>Thanks! </p>
  
  <pre><code>import React, { Component } from "react";
  import { googleTranslate } from '../utils/googleTranslate';
  
  class Translator extends Component {
      constructor(){
          super();
  
          this.state = {
               input:'',
               translatedInput: '',
          }
      }
  
      handleTextInput = e =&gt; {
          this.setState({input:e.target.value})
      }
  
      translateInput = () =&gt; {
          googleTranslate.translate([this.state.input],"en", "de", 
          function (err, translations){        
        //this.setState({translatedInput:translations.translatedText}) 
        //TypeError: Cannot read property 'setState' of undefined
          console.log(translations.translatedText)
          })
      }
  </code></pre>