-
Notifications
You must be signed in to change notification settings - Fork 50k
Open
Labels
Status: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bugType: Bug
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-hooks (build issue installing or using the eslint plugin)
- react-compiler-healthcheck (build issue installing or using the healthcheck script)
Link to repro
Repro steps
Given this input:
import React from 'react';
const base = 'div';
const TestComponent: React.FC = () => {
const Comp = base;
return <Comp/>
};
export default function Home() {
return <TestComponent />
}The compiler outputs this for the TestComponent
const TestComponent: React.FC = () => {
const $ = _c(1);
let t0;
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
t0 = <base />;
$[0] = t0;
} else {
t0 = $[0];
}
return t0;
};First reported here: vercel/next.js#86728
This outputs a <base /> tag instead of a div.
I searched on issues before posting, but I couldn't find other reports.
How often does this bug happen?
Every time
What version of React are you using?
Next.js' version on 16.0.6
What version of React Compiler are you using?
1.0.0
Metadata
Metadata
Assignees
Labels
Status: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bugType: Bug