What kind of issue is this?
Link to repro
https://playground.react.dev/#N4Igzg9grgTgxgUxALhAMygOzgFwJYSYAEAJABTBwAWeANgCYwKYC+AlEcADrFFM6xiAHnp4AbgD5KNBk1ZCA9KMk8WPHggAeABwgwcRegjQBDKLQMZs+QkQCyATwCC27WQ7de-QUSEkJQlQAjBIAEgi0tBBEAOp6DACEisEBCv6qPCAANCBwhGh4AOYoIHgAtrr6RDgO2gicRAAKtFCFeJgA8to2mGBELERoMBBlRADkAEYmExEAtNotbZizTCa4s3kVdAgwSnhgOGMA3OqYFDxERAoKm9p0Jj12EEbIRFwgJpHvqkRgD-sFBB9ZqtdpdHpgNhHbLgKgQADuAElMDgdphPmAUKZaGAECwgA
Repro steps
In my codebase, I have a utility component called <$> that I use as a succinct shortcut for inline styles.
// this
<$ fs="10em" x="30%" y="10%">
<h1>Hello World!</h1>
</$>
// is equivalent to this
<h1 style={{fontSize: "10em", left: "30%", position: "absolute", top: "10%"}}>Hello World!</h1>
This works in Server Components, but breaks in Client Components. It seems that React Compiler uses $ and _c as reserved variables, which overwrite my component. So either
- the Compiler should detect when
$ in the scope and choose a different variable name, or
- the docs should include a warning about this (apologies if they already do, I couldn't find any)
How often does this bug happen?
Every time
What version of React are you using?
19.2.4
What version of React Compiler are you using?
1.0.0
What kind of issue is this?
Link to repro
https://playground.react.dev/#N4Igzg9grgTgxgUxALhAMygOzgFwJYSYAEAJABTBwAWeANgCYwKYC+AlEcADrFFM6xiAHnp4AbgD5KNBk1ZCA9KMk8WPHggAeABwgwcRegjQBDKLQMZs+QkQCyATwCC27WQ7de-QUSEkJQlQAjBIAEgi0tBBEAOp6DACEisEBCv6qPCAANCBwhGh4AOYoIHgAtrr6RDgO2gicRAAKtFCFeJgA8to2mGBELERoMBBlRADkAEYmExEAtNotbZizTCa4s3kVdAgwSnhgOGMA3OqYFDxERAoKm9p0Jj12EEbIRFwgJpHvqkRgD-sFBB9ZqtdpdHpgNhHbLgKgQADuAElMDgdphPmAUKZaGAECwgA
Repro steps
In my codebase, I have a utility component called
<$>that I use as a succinct shortcut for inline styles.This works in Server Components, but breaks in Client Components. It seems that React Compiler uses
$and_cas reserved variables, which overwrite my component. So either$in the scope and choose a different variable name, orHow often does this bug happen?
Every time
What version of React are you using?
19.2.4
What version of React Compiler are you using?
1.0.0