-
Notifications
You must be signed in to change notification settings - Fork 50k
Open
Description
What kind of issue is this?
- React Compiler core (the JS output is incorrect, or your app works incorrectly after optimization)
- babel-plugin-react-compiler (build issue installing or using the Babel plugin)
- eslint-plugin-react-compiler (build issue installing or using the eslint plugin)
- react-compiler-healthcheck (build issue installing or using the healthcheck script)
Link to repro
Repro steps
- Go to https://playground.react.dev/ (make sure to clear your site data before loading this, because it likes to autosave your code, even if it causes the sandbox to crash)
- Paste the following
import React, { useState } from "react";
function FormWithObjectFromEntries({ fields }) {
const handleSubmit = async (event) => {
try {
for (const [key, value] of Object.entries(fields)) {
console.log(key, String(value));
}
} catch (e) {}
};
return (
<button type="button" onClick={handleSubmit}>
Submit
</button>
);
}
export default FormWithObjectFromEntries;
(Note that this is a minimal reproducible example, I got this issue in a larger codebase)
Expected:
React compiler compiles the component
Actual (in real code base)
React compiler skips this component
Actual (In playground)
The playground crashes
How often does this bug happen?
Every time
What version of React are you using?
19.2.0