title: Next.js: Execute async code before hydration on client-side
body: <p>I need to load a <a href="https://day.js.org/docs/en/i18n/changing-locale" rel="nofollow noreferrer"><code>dayjs</code> locale</a> dynamically on the client side. On the server, I can just require it and it works, but it will always lead to a hydration mismatch because there's no way on the client to wait until the</p>
  <pre><code>import(`dayjs/locale/${locale}.js`)
  </code></pre>
  <p>actually completes. Can I somehow tell next to wait for the import before beginning re-hydration on the client (since the server-rendered html is actually correct and rendered with the correct locale)?</p>