Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

render twice when i use react 18 #37274

Closed
1 task done
757566833 opened this issue May 29, 2022 · 3 comments
Closed
1 task done

render twice when i use react 18 #37274

757566833 opened this issue May 29, 2022 · 3 comments
Labels
bug Issue was opened via the bug report template.

Comments

@757566833
Copy link

Verify canary release

  • I verified that the issue exists in Next.js canary release

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10 Pro
Binaries:
  Node: 14.17.3
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant packages:
  next: 12.1.7-canary.19
  react: 18.1.0
  react-dom: 18.1.0

What browser are you using? (if relevant)

chrome 102.0.5005.62

How are you deploying your application? (if relevant)

next dev

Describe the Bug

render twice

Expected Behavior

render once

To Reproduce

  1. download file:///D:/Downloads/material-ui-master.zip
  2. cd examples\nextjs-with-typescript
  3. change the next version to 12.1.5 ( because 12.1.6 CSS generation regression #36675)
  4. yarn install
  5. add effect in pages/index.tsx
const Home: NextPage = () => {
    useEffect(()=>{
        console.log("effect")
    },[])
...
}
  1. yarn dev
  2. chrome dev tools console two effect appear

I also tested 12.1.7-canary.18 and he has the same problem
when i change react to 17 the problems will not arise

@757566833 757566833 added the bug Issue was opened via the bug report template. label May 29, 2022
@SukkaW
Copy link
Contributor

SukkaW commented May 29, 2022

Duplicate as #36920

@balazsorban44
Copy link
Member

Please see #35822

@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

3 participants