vercel / next.js

The React Framework
https://nextjs.org
MIT License
124.84k stars 26.65k forks source link

Dynamically imported component is rendered twice on the client #10028

Closed OndrejTuma closed 2 years ago

OndrejTuma commented 4 years ago

Bug report

When using dynamically imported component with next/dynamic function, my component is always rendered twice

Describe the bug

image

This bug is quite self-descriptive

To Reproduce

It can be seen in official repo in example with-dynamic-import

  1. Go to https://github.com/zeit/next.js/tree/canary/examples/with-dynamic-import and clone it, or
  2. check it in codesandbox https://codesandbox.io/s/nexjs-dynamic-import-double-render-g060p

Expected behavior

Component should be rendered only once

System information

tardnuk commented 4 years ago

Just to clarify - it is not renderd twice on page, but it is rerenderd.

BhupenT commented 4 years ago

I am also facing this issue. @Rootre have you found any solution round this?

Jekins commented 4 years ago

I am also facing this issue.

PaulinaQuintero commented 4 years ago

In the sandbox I think it is rendered once image

balazsorban44 commented 2 years ago

Given the reproduction, this no longer reproduces. Please try upgrading to next@latest

balazsorban44 commented 2 years ago

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.