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

Bug: react-compiler-healthcheck doesn't recognize when strict mode is enabled with <React.StrictMode /> #29075

Closed
psychedelicious opened this issue May 15, 2024 · 1 comment · Fixed by #29076
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@psychedelicious
Copy link

React version: 18.3.1

Steps To Reproduce

  1. Create a react application

  2. Use <React.StrictMode /> to enable strict mode (instead of <StrictMode />

  3. Run npx react-compiler-healthcheck:

    ❯ npx react-compiler-healthcheck
    Successfully compiled 1 out of 1 components.
    StrictMode usage not found.
    Found no usage of incompatible libraries.

Link to code example:

This repo was created by running pnpm create vite and selecting React with Typescript. No changes were made to the code.

https://github.com/psychedelicious/react-compiler-healthcheck_strict-mode

The current behavior

The health check doesn't recognize when strict mode is enabled with <React.StrictMode />.

The expected behavior

The health check recognizes when strict mode is enabled with <React.StrictMode />.

@psychedelicious psychedelicious added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label May 15, 2024
psychedelicious added a commit to psychedelicious/react that referenced this issue May 15, 2024
…t.StrictMode/>`

Update the regex to match both `<StrictMode>` and `<React.StrictMode>`.

Closes facebook#29075
gsathya added a commit that referenced this issue May 15, 2024
Previously, we only checked for StrictMode by searching for
`<StrictMode>` but we should also check for the namespaced version,
`<React.StrictMode>`.

Fixes #29075
@zolotoygagash
Copy link

go,here Binace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
2 participants