-
Notifications
You must be signed in to change notification settings - Fork 49.1k
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
Run eslint-plugin-react-hooks with the react-compiler rule enabled
export default function MyApp() {
const startTime = useMemo(() => performance.now());
}
The error says
Calling an impure function can produce unstable results that update unpredictably when the component happens to re-render
I’m not sure what the right way to record this type of state is now, because react-compiler also rejects anything of the form
const [startTime, setStartTime] = useState(null);
useEffect(() => { setStartTime(performance.now()); }, []);
for “calling setState synchronously within an effect body.”
How often does this bug happen?
Every time
What version of React are you using?
react@19.1.1
What version of React Compiler are you using?
eslint-plugin-react-hooks@0.0.0-experimental-97cdd5d3-20250710