title: Mocking snackbar using jest
body: <p>I try to test the following code</p>
  <pre><code>import { useSnackbar, VariantType, WithSnackbarProps } from 'notistack';
  import React from 'react';
  
  interface IProps {
    setUseSnackbarRef: (showSnackbar: WithSnackbarProps) =&gt; void;
  }
  
  const InnerSnackbarUtilsConfigurator: React.FC&lt;IProps&gt; = (props: IProps) =&gt; {
    props.setUseSnackbarRef(useSnackbar());
    return null;
  };
  
  let useSnackbarRef: WithSnackbarProps;
  const setUseSnackbarRef = (useSnackbarRefProp: WithSnackbarProps) =&gt; {
    useSnackbarRef = useSnackbarRefProp;
  };
  
  export const SnackbarUtilsConfigurator = () =&gt;
    &lt;InnerSnackbarUtilsConfigurator setUseSnackbarRef={setUseSnackbarRef} /&gt;;
  
  export default {
    success(msg: string) {
      this.toast(msg, 'success');
    },
    warning(msg: string) {
      this.toast(msg, 'warning');
    },
    info(msg: string) {
      this.toast(msg, 'info');
    },
    error(msg: string) {
      this.toast(msg, 'error');
    },
    toast(msg: string, variant: VariantType = 'default') {
      useSnackbarRef.enqueueSnackbar(msg, { variant });
    },
  };
  </code></pre>
  <p>if I mock the complete notistack object</p>
  <pre><code>import React from &quot;react&quot;;
  import {render as testingRender} from '@testing-library/react';
  import { SnackbarProvider} from 'notistack';
  import SnackbarUtils,{SnackbarUtilsConfigurator} from './SnackbarUtils';
  
  jest.mock('notistack');
  
  beforeEach(() =&gt;{
  
  });
  
  it('DownloadDialog renders correctly - open=true', async () =&gt; {
      const component = await  testingRender(&lt;SnackbarProvider maxSnack={3}&gt;&lt;SnackbarUtilsConfigurator /&gt;&lt;/SnackbarProvider&gt;);
      SnackbarUtils.success(&quot;success&quot;);
  });
  </code></pre>
  <p>I get an error message:</p>
  <p>TypeError: Cannot read property 'enqueueSnackbar' of undefined</p>
  <pre><code>  33 |   },
    34 |   toast(msg: string, variant: VariantType = 'default') {
  &gt; 35 |     useSnackbarRef.enqueueSnackbar(msg, { variant });
       |                    ^
    36 |   },
    37 | };
  </code></pre>
  <p>because <code>useSnackbarRef</code>.</p>
  <p>How can i mock only the <code>useSnackbar</code> method of <code>notitstack</code>, so that i can check if <code>enqueueSnackbar</code> is called with the correct values?</p>