Skip to content

[Bug]: Menu control not appearing in NextJS / React 19 #31429

Description

Library

React Components / v9 (@fluentui/react-components)

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (32) x64 13th Gen Intel(R) Core(TM) i9-13900K
    Memory: 15.25 GB / 63.76 GB
  Browsers:
    Edge: Chromium (123.0.2420.97)
    Internet Explorer: 11.0.22621.3527

Are you reporting Accessibility issue?

no

Reproduction

https://github.com/jkizziar/nextjs-fluentui-menu-issue

Bug Description

Actual Behavior

Menu context does not appear utilizing a base nextjs install with fluentui react components. Using following versions:
"@fluentui/react-components": "^9.52.0",
"next": "14.2.3",
"react": "^18",
"react-dom": "^18"

Expected Behavior

Expecting to see context menu. Tested same code using latest Vite and it is working.

Logs

No response

Requested priority

Normal

Products/sites affected

No response

Are you willing to submit a PR to fix?

yes

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.

Activity

  1. jkizziar commented on May 21, 2024

    @jkizziar
    Author

    I took it too bare bones for reproduction - but I've added the SSR and RendererProvider and now have it matching essentially verbatim to the example and setup reference and still do not get the context to show. Updated github repo.

  2. jkizziar commented on May 21, 2024

    @jkizziar
    Author

    I was able to get around the issue by setting reactStrictMode fo false in the next.config.mjs file:

    /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: false, }; export default nextConfig;

    Without this both the menu context and drawers set to overlay will not appear.

  3. layershifter commented on May 22, 2024

    @layershifter
    Contributor

    Jerry Kizziar (@jkizziar) thanks, I was able to repro it.

    Next uses React 18.3.0-canary-14898b6a9-20240318 which seems to contain changes from React 19 beta related to effects.

    18.3

    https://stackblitz.com/edit/vitejs-vite-2qfxth

    useMemo
    render {i: 1}
    useMemo
    render {i: 2}
    useEffect
    useEffect
    

    18.3.0-canary-14898b6a9-20240318

    https://stackblitz.com/edit/vitejs-vite-qnt1wx

    useMemo
    useMemo
    render {i: 2}
    render {i: 2}
    useEffect
    useEffect
    

    I suggest to disable Strict Mode for mode, we will look for a proper fix. The problem occurs in Portal because of useDisposable() usage.

  4. tomivm commented on Sep 9, 2024

    @tomivm

    Waiting for a better solution :)
    image

  5. changed the title [-][Bug]: Menu control not appearing in NextJS[/-] [+][Bug]: Menu control not appearing in NextJS / React 19[/+] on Apr 24, 2025
  6. layershifter commented on Jun 27, 2025

    @layershifter
    Contributor

    The revert will be merged #34737, so the issue is back on the radar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions