-
Notifications
You must be signed in to change notification settings - Fork 47.7k
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
[Compiler Bug]: "use no memo"
Directive ignored by React Compiler Playground
#31331
Comments
I took a look and couldn't repro the issue. We do have tests covering this so I'm wondering if it's something with how your repo is setup. Could you share a repo with the repro instead? |
@piotrski how are you checking if the component is compiled or not? using the devtools or manually inspecting the source? |
I think OP talks about the playground result, you can clearly see that the component has been transformed by the react compiler. |
The directive doesn't work on the playground. |
I was discussing ESLint and Playground, and I find the Playground behavior misleading. When you choose opt out using |
The eslint plugin doesn't follow Your feedback about the playground is fair though, we should probably support it there |
"use no memo"
Directive ignored by React Compiler"use no memo"
Directive ignored by React Compiler Playground
@piotrski would you be interested in adding support for this in the compiler playground? |
@poteto sure, I can give it a shot! |
1) Adds support for 'use memo' and 'use no memo' 2) Cleanup E2E test cases a bit 3) Adds test cases for use memo 4) Added documentation to run test cases
@poteto in my PR, seems like some E2E tests I wrote were failing on the CI but working on my machine. Also, i missed the prettier pass :(. I fixed these two. How do i rerun the the compiler workflow on CI? |
What kind of issue is this?
Link to repro
https://playground.react.dev/#N4Igzg9grgTgxgUxALhAMygOzgFwJYSYAEAwhALYAOhCmOAFAJRHAA6xRrIUYCRmEIuQTkIXANzsiROITA4iAbVlYcAGiK8cZVQF0iAXiI8EAZRwBDHAnoAGRpI4wEOWMQA8AEzwA3AHzAKnQAvu4A9N7+jsEgwUA
Repro steps
To reproduce the issue, create a simple React component and add the
"use no memo"
directive at the top of the function, like this:Even though the directive is there, the component still gets compiled, which shouldn’t happen according to the documentation. I’ve also tried placing the directive at the top of the file, and the behavior doesn't change.
To confirm, I tested this in different components and even in a fresh project, but the components keep getting compiled regardless of the directive.
The same result appears in the React Compiler Playground, showing that the
"use no memo"
directive is being ignored.How often does this bug happen?
Every time
What version of React are you using?
19
What version of React Compiler are you using?
19.0.0-beta-8a03594-20241020
The text was updated successfully, but these errors were encountered: