[Compiler Bug]: Can't handle identifiers that refer to both type and value #29224
Labels
Component: Optimizing Compiler
Status: Unconfirmed
A potential issue that we haven't yet confirmed as a bug
Type: Bug
What kind of issue is this?
Link to repro
https://playground.react.dev/#N4Igzg9grgTgxgUxALhASwLYAcIwC4AEwBAwhBhggHZ4BKCAhnHmhFQQL4EBmM5BAHRAA6APR4AnlgRghAbgFVFaGghjcmCAgAU+WMEUUECMRs1ZVkpcpRr0mLNgqodFi7lCrm21itTpmjlQAFMSmDhacVroQ+gCUhuwmCHiw7FRQADaZzq5UIBxAA
Repro steps
Apply React Compiler to
resulting JS issues
TypeError: Duplicate declaration "CommentReaction"
when passed throughbabel-plugin-react-compiler
. The playground produces a build error.This is easily fixable by changing the code to
The original code is actually valid TypeScript (though I would not recommend authoring it this way). Despite
CommentReaction
being both a type and value, TypeScript is able to distinguish when it's used as a value vs type.How often does this bug happen?
Every time
What version of React are you using?
19.0.0-beta-04b058868c-20240508
The text was updated successfully, but these errors were encountered: