title: How to use `this` in react-native-collapsible accordion component?
body: <p>I have a react-native screen, where I want to use react-native-collapsible accordion component to show a list of assets. In the required <code>rendercontent</code> prop of accordion, I pass in a function <code>sellAsset</code> defined inside the screen component where I use <code>this</code> keyword to refer to the screen component. But it didn't work, always telling me <code>this.sellAsset is not a function</code>. Please see the code below.</p>
  
  <p>Tried some function binding but didn't work. It seems the <code>this</code> passed to the accordion component does not point to the screen component. </p>
  
  <p>So how to call <code>this.sellAsset</code> correctly?</p>
  
  <pre><code>renderContent(item) {
      return (
          &lt;View style={[styles.imageContent]}&gt;
            &lt;View style={[styles.detailContainer, {paddingVertical: 0}]}&gt;
              &lt;Image source={getImage(_.get(item, ['Asset', 'image']))} resizeMode="contain" style={styles.assetImage}/&gt;
            &lt;/View&gt;
            &lt;View style={styles.priceContainer}&gt;
              &lt;CustomSignInButton
                  text="SELL"
                  onPress={() =&gt; {this.sellAsset();}}
                  buttonBackgroundColor="transparent"
                  buttonBorderColor="white"
                  buttonTextColor="white"
                  buttonHeight={30}
              /&gt;
            &lt;/View&gt;
          &lt;/View&gt;
      );
    }
  
  render() {
      return (
          &lt;LinearGradient colors={[Colors.splashGradient.top, Colors.splashGradient.middle, Colors.splashGradient.bottom]}
                          style={{flex: 1}}&gt;
            &lt;View style={styles.container}&gt;
              &lt;IOSStatusBar backgroundColor="transparent"/&gt;
              {this.state.transactionDetails !== null ?
                  (this.state.transactionDetails.length &gt; 0 &amp;&amp;
                      &lt;Accordion sections={this.state.transactionDetails} renderHeader={this.renderHeader}
                                 renderContent={this.renderContent} underlayColor={Colors.rowSeparatorBlue}
                      /&gt;
                  ) : &lt;View/&gt;
              }
            &lt;/View&gt;
          &lt;/LinearGradient&gt;
      );
    }
  }
  </code></pre>