title: React-hot-loader using craco
body: <p>I've been trying to get react-hot-loader to work in my project and have got it setup according to the instructions in the <a href="https://github.com/gaearon/react-hot-loader#react-hot-loader" rel="nofollow noreferrer">package readme</a>. The main difference is that I'm using craco in this project and so step 1 means I have added</p>
  
  <pre><code>    babel: {
        plugins: ["react-hot-loader/babel"],
      },
  </code></pre>
  
  <p>to my <code>craco.config.js</code>.</p>
  
  <p>My root component is marked as hot-exported:</p>
  
  <pre><code>// ...
  import { hot } from 'react-hot-loader/root';
  // ...
  
  function App() {
    return (
      &lt;div&gt;
        &lt;Suspense fallback={loadingFB()}&gt;
          &lt;Provider store={userStore}&gt;
            &lt;ProvideAuth&gt;
              &lt;Router /&gt;
            &lt;/ProvideAuth&gt;
          &lt;/Provider&gt;
        &lt;/Suspense&gt;
      &lt;/div&gt;
    );
  }
  
  export default hot(App);
  </code></pre>
  
  <p>I've got <code>import 'react-hot-loader';</code> first in my <code>index.js</code></p>
  
  <p>And finally I've installed <code>@hot-loader/react-dom</code> using the following yarn command:
  <code>yarn add react-dom@npm:@hot-loader/react-dom</code></p>
  
  <p>I am currently not getting any warning/errors on compile or in the browser console. But when I refresh the page or manually try to go to any subpage by writing it's url I loose all state.</p>
  
  <p>Anyone got any idea what's missing?</p>