title: How to call a function in the render function?
body: <p>If I try to call the <code>fetchToken()</code> function it just says that it is not a function. If I put it outside of the render function <code>this.props</code> is <code>undefined</code> and i'm not able to call it.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>class LoginPage extends Component {
  
  
      componentDidMount() {
          Linking.addEventListener('url', this.handleOpenURL);
      }
      componentWillUnmount() {
          Linking.removeEventListener('url', this.handleOpenURL);
      }
      handleOpenURL(event) {
          let code = event.slice(22,86);
          console.log(code);
          this.fetchToken(code)
      }
    
    render() {
  
          function fetchToken(code) {
              this.props.actions.fetchToken(code)
          }
          
          return (
              &lt;View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}&gt;
                  &lt;TouchableHighlight style={{backgroundColor: '#9b59b6', height: 70, padding: 20}} onPress={this.openAuth.bind(this)}&gt;
                      &lt;View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}&gt;
                          &lt;Text style={{color: 'white', fontSize: 16}}&gt;Authenticate with Dribbble&lt;/Text&gt;
                      &lt;/View&gt;
                  &lt;/TouchableHighlight&gt;
              &lt;/View&gt;
          )
      }
  }</code></pre>
  </div>
  </div>
  </p>