title: cannot destructure property as it is undefined error
body: <p>Creating an <code>onClick</code> event to open a cart drawer and receiving the error 'Cannot restructure property 'shoppingCartOpen' of 'value' as it is undefined'. How do I resolve it?</p>
  <pre><code>const ButtonAppBar = ({value}) =&gt; {
    const { shoppingCartOpen } = value
    let shoppingCartDrawer;
    if (this.state.shoppingCartOpen) {
      shoppingCartDrawer = &lt;ShoppingCartDrawer /&gt;;
    }
  </code></pre>