title: Optional object parameter in typescript
body: <p>I am creating a simple function with an object parameter. It accepts <code>openDialog</code> boolean property which decides whether to run another function. I am not defining an interface for it because it is ever going to be a single property. My issue is how do I define it in such a way that I am no longer required to pass an empty object to that function? <code>openDialog</code> is optional so what is the right syntax for making that object optional too?</p>
  <pre><code>function renderComponent({ openDialog }: { openDialog?: boolean }) {
    render(
      &lt;Component /&gt;
    );
  
    if (openDialog) clickButton('Import Existing');
  }
  </code></pre>
  <p>Typescript complains about <code>renderComponent()</code> with</p>
  <blockquote>
  <p>Expected 1 arguments, but got 0.</p>
  </blockquote>
  <p>It accepts <code>renderComponent({})</code></p>
  <p>I am aware of a default parameter <code>function renderComponent({ openDialog }: { openDialog?: boolean } = {}) {</code> but I am wondering whether there is a different way.</p>