title: Possible Unhandled Promise Rejection undefined is not a function
body: <p>I am using React Native. I have already check out <a href="https://stackoverflow.com/questions/40500490/what-is-unhandled-promise-rejection">What is an unhandled promise rejection?</a>, but I can't understand it at all.</p>
  <p>When I create a component:</p>
  <pre class="lang-js prettyprint-override"><code>render(){
      const MenuComponent = (
        &lt;MenuScreen CloseSlideMenu={this.SlideMenu.CloseSlideMenu} /&gt;
      )
      ...
  }
  </code></pre>
  <p>I get the following error:</p>
  <blockquote>
  <p>'Possible Unhandled Promise Rejection (id: 0) TypeError: undefined is
  not a function (evaluating
  '_this.OpenSlideMenu.bind(true).then(function() {}))'</p>
  </blockquote>
  <p><code>this.OpenSlideMenu()</code> is declared in the <code>constructor()</code>.</p>
  <pre><code>constructor (props, context) {
    super(props, context)
  
    this.OpenSlideMenu = this.OpenSlideMenu.bind(true).catch(function(e){
      console.log(&quot;Promise Rejected&quot;);
    });
    this.CloseSlideMenu = this.CloseSlideMenu.bind(true).catch(function(e){
      console.log(&quot;Promise Rejected&quot;);
    });
  }
  </code></pre>
  <p>this.drawer is declared in the render() method:</p>
  <pre><code>render () {
    const MenuComponent = (
      &lt;MenuScreen CloseSlideMenu={this.SlideMenu.CloseSlideMenu} /&gt;
    )
  
    return (
      &lt;Drawer
        ref={(ref) =&gt; this.drawer = ref}
        content={MenuComponent}
        tapToClose={true}
        openDrawerOffset={170}
        stles={drawerStyles}
        panCloseMask={0.2}
        closedDrawerOffset={-3}
        styles={drawerStyles}
        tweenHandler={(ratio) =&gt; ({
          main: { opacity: (2-ratio)/2 }
        })}&gt;
        &lt;GroceryScreen selectedCategory='Todos' OpenSlideMenu={this.OpenSlideMenu} /&gt;
      &lt;/Drawer&gt;
    )
  }
  </code></pre>
  <p><strong>Could someone explain to me why I have this error? How do I fix this?</strong></p>