title: What is causing this enqueue snackbar error for notistack?
body: <p>I'm trying to use the useSnack hook from notistack library but I keep getting this error</p>
  <blockquote>
  <p>TypeError: Cannot destructure property 'enqueueSnackbar' of 'Object(...)(...)' as it is undefined.</p>
  </blockquote>
  <p>Here is the code:</p>
  <pre><code>import React, { useContext, useEffect } from &quot;react&quot;;
  import AlertContext from &quot;../context/alert/alertContext&quot;;
  import { SnackbarProvider, useSnackbar } from &quot;notistack&quot;;
  
  const Alerts = (props) =&gt; {
    const alertContext = useContext(AlertContext);
    // This line below is where the error seems to be
    const { enqueueSnackbar } = useSnackbar();
    useEffect(() =&gt; {
      alertContext.msg !== &quot;&quot; &amp;&amp;
        enqueueSnackbar(alertContext.msg, {
          variant: alertContext.type,
        });
    }, [alertContext]);
    return &lt;SnackbarProvider maxSnack={4}&gt;{props.children}&lt;/SnackbarProvider&gt;;
  };
  
  export default Alerts;
  </code></pre>