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)
What kind of issue is this?
Link to repro
https://playground.react.dev/#N4Igzg9grgTgxgUxALhAHQHaYJYFsAOEMALgAQBKCAhnMQDSnClRgIDKxVxCpAvqQDMYEXKTQgY1WuIDcmTAKgZa2CBlIAxIrgDq2YgAsA8gCMAVglobhuAKIZiMbAjAAKJgOcAbACZg+AJSMmKSkcGpgZAZUGD5e7FAmuPqkALykVGAAnsqkrggAbggOQakAfMFYxI5ZlWhkoQJEeeEYkaQA2gDWCFkMBVReUAgAuqQQAqSmFrQAdMWOzm6eCL5gAUHA8sT1rZDxs14QAOauPX2kHE4YpwNDCBtyVbzb-HBccAZ5D3XEL+p8J4hUiSYiwdSuYGhAA8Jig1TUpGIWXwCFS4jhCKwIHGGAAwl5sHAuqlgNFYvE2Ilkn8ylSkvpoQB6THENRlYEBJ7-TAIAAehBIpB8CAEVCgXjIWhgun0xnMlmI1hE9kWLhkIDoIFanmOKBAeEFZGRqMYpAACkNjtgMEZ8MRVG0+IIbKQAOQmKgmVYAWnwVptPskNGIPvCBGw8RgTJ82EibqBGHcwKZTPD+EjXEdAFkICLkGIQIMvOJMPwwFmwCt-JaoNbbfbHesNVqwAYIAB3ACSDgQMAwgzAKDFXlYvCAA
Repro steps
(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
What version of React Compiler are you using?
babel-plugin-react-compiler@19.1.0-rc.3