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

React Server Components don't work with reactStrictMode #33847

Closed
benkeil opened this issue Feb 1, 2022 · 2 comments
Closed

React Server Components don't work with reactStrictMode #33847

benkeil opened this issue Feb 1, 2022 · 2 comments
Labels
bug Issue was opened via the bug report template.

Comments

@benkeil
Copy link

benkeil commented Feb 1, 2022

Run next info (available from version 12.0.8 and up)

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:41 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T6000
Binaries:
  Node: 16.13.2
  npm: 8.1.2
  Yarn: 1.22.17
  pnpm: 6.28.0
Relevant packages:
  next: 12.0.9
  react: 18.0.0-rc.0
  react-dom: 18.0.0-rc.0

What version of Next.js are you using?

12.0.9

What version of Node.js are you using?

v16.13.2

What browser are you using?

Safari

What operating system are you using?

macOS

How are you deploying your application?

next dev

Describe the Bug

When you use React Server Components and want to render a client component which uses e.g. useState and you have reactStrictMode enabled, the client component don't execute any javascript.

Expected Behavior

Should work

To Reproduce

Checkout the next-rsc-demo and modify next.config.js to:

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  experimental: {
    reactRoot: true,
    concurrentFeatures: true,
    serverComponents: true,
  },
};

module.exports = nextConfig;
@benkeil benkeil added the bug Issue was opened via the bug report template. label Feb 1, 2022
@balazsorban44
Copy link
Member

Hi, this has likely been fixed by #34333

I wasn't able to reproduce the issue using the latest demo code. If you still hit this, please open a new issue, thanks! 🙏

@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 Mar 20, 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

2 participants