title: TypeError: Object(...) is not a function when using react-toastify
body: <p>I'm trying to get <code>react-toastify</code> to work in an app I'm writing while following an online course. I'm supposed to install a specific version but I always prefer using the very latest one but when I do, I'm getting a bunch of errors.</p>
  <p>I've gone to the <code>npm</code> home page for <a href="https://www.npmjs.com/package/react-toastify" rel="nofollow noreferrer">React-Toastify</a> and they provide very good documentation on how to use it and I believe I've followed the instructions from both the course and <code>react-toastify</code> correctly but I'm still getting an error.</p>
  <p>I've defined <code>react-toastify</code> as the top of my App.js</p>
  <pre><code>import { ToastContainer, toast } from &quot;react-toastify&quot;;
  import &quot;react-toastify/dist/ReactToastify.css&quot;;
  </code></pre>
  <p>and I'm simply calling a test toast as follows:</p>
  <pre><code>handleDelete = (post) =&gt; {
      toast(&quot;deleted&quot;);
      // toast.error(&quot;deleted&quot;);       
  }
  </code></pre>
  <p>and in my render method I have the <code>&lt;ToastContainer /&gt;</code>:</p>
  <pre><code>render() {
      return (
         &lt;React.Fragment&gt;
         &lt;ToastContainer /&gt;
         &lt;button className=&quot;btn btn-error&quot; onClick={this.handleDelete}&gt;
            Delete
         &lt;/button&gt;
  </code></pre>
  <p>When I click on my delete button I get an error (well I'm actually getting a bunch of them but this is the main one):</p>
  <pre><code>TypeError: Object(...) is not a function
  useToastContainer
  ..myapp/node_modules/react-toastify/dist/react-toastify.esm.js:866
    863 | }
    864 | 
    865 | function useToastContainer(props) {
  &gt; 866 |   var _useReducer = useReducer(function (x) {
    867 |     return x + 1;
    868 |   }, 0),
    869 |       forceUpdate = _useReducer[1];
  </code></pre>
  <p>Actually, I've just noticed that my <code>&lt;ToastContainer /&gt;</code> was commented out in my render method and the second I uncomment it, the same error occurs immediately as my page loads.</p>
  <p>Am I missing something or is this a bug with <code>react-notify</code> and the version of <code>React</code> I'm using i.e. 16.4.1?</p>