-
Notifications
You must be signed in to change notification settings - Fork 45.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]: Can't handle Dynamic JavaScript Object Keys #29583
Comments
It's worth noting that it won't compile in playground, but will skip compilation in the local project, which doesn't have any configuration items set for babel-plugin-react-compiler. |
Thanks for posting! React Compiler supports a broad range of JavaScript (and TypeScript/Flow) syntax, but there are some syntax forms we don't yet support. Computed object expression keys is on the list of todos. We allowlist the syntax we intend to support and skip compiling functions that use unsupported syntax. The playground shows all errors, but as @Y-Hui noted if you use a function like this locally we'll just skip it without error (w default configuration, which is strongly recommended). I'm going to close since this is a known todo and not a bug. Thanks again for posting! |
Got it - thanks! |
What kind of issue is this?
Link to repro
https://playground.react.dev/#N4Igzg9grgTgxgUxALhAgdlAtgAgMoAuAhgVGDsADro75RyJhgBmUANgDTW0Cq6Y9Ri3ZcaOAEoIAVgjgEAlgDcEogL7VqCAB4AHCDAI5W6OfIg1CJMgBUiAcwAUOmBB1gAlBW4445sIeAcfytyVRwAXhxnVzANMV9+QwSCDENIqjFaAG1LUjAAOjxBBCZWNgBdZBwAHgBhCCw9dFSAQRwAegA+UVps3LJ8vgEGEuEKqrqGptSAIQ7u7z7iPPzJGVNlSpr6xvNU2vmenHV0bwT-HGI7QgBPNhKIr0ycHOWBopHS9i2AcgAjOwAWjsMAQGEBAEYAAxQnB-fQAEwQMDhiORwNB4IArDDLtoCBiwehAQB2GE-I5LEKDfjFL7jHD-IGghF4rQEgDuAAt5CkKYsXv0CmtZApNlUmYD9ER0HYEGzOTy+UcTt5QaQYDQHALqgilD42EQmAA5IhYBDhYBwNhgLQOH5XCmXey3e5gLLBPLldyqToC2hW8wpdAED1vMDlE69GrtPWKP1idzUVXoYymcw4HbTEMtByeDK0dWwGiUEAIiAldAOnBYEgpGClgDcyeoaYUGazexDMzzT0LCA1JbLFbAVcMtYI9abLdTUBM7ZoneaIdqvYLOCLmpwpfLlerE6nIGb6BOIFUQA
Repro steps
When writing the above code within the component, it fails to compile.
It gets an error like this
How often does this bug happen?
Every time
What version of React are you using?
19
The text was updated successfully, but these errors were encountered: