title: How to bind a function in ReactJS with optional parameters?
body: <p>Let's say I've got a function I need to bind in the React component constructor because it will be passed down as props to the child component.</p>
  
  <p>The function has one optional parameter that has a default value if none is specified. What is the syntax for binding this kind of function?</p>
  
  <p>Let's say I've got a function with an optional paramter that has a default value if none is specified:</p>
  
  <pre><code>_handleEdit(isTwoWay: boolean = false):void {}
  </code></pre>
  
  <p>What's the syntax for doing that in the declaration?</p>
  
  <pre><code>class Component extends React.Component&lt;void, void, void&gt; {
  
      _handleEdit: (isTwoWay: boolean = false) =&gt; void;
  
      constructor(): void {
          super();
  
          this._handleEdit = this._handleEdit.bind(this);
      }
  
      _handleEdit(isTwoWay: boolean = false): void {
      }
  
  }
  </code></pre>
  
  <p>This syntax does not pass the flow check or build:
   _handleEdit: (isTwoWay: boolean = false) => void;</p>