mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
Repro for fbt:enum source location issue
Fbt enums appear to rely on source locations and something that we're doing (maybe destructuring?) isn't preserving locations such that the fbt plugin breaks.
This commit is contained in:
1 parent
7257c9b4f8
commit
501481ccea
2 files changed
+35
No files matched your search
+25
@@ -0,0 +1,25 @@
|
||||
|
||||
## Input
|
||||
|
||||
```javascript
|
||||
import fbt from "fbt";
|
||||
|
||||
function Component({ a, b }) {
|
||||
return (
|
||||
<fbt desc="Description">
|
||||
<fbt:enum enum-range={["avalue1", "avalue1"]} value={a} />{" "}
|
||||
<fbt:enum enum-range={["bvalue1", "bvalue2"]} value={b} />
|
||||
</fbt>
|
||||
);
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
## Error
|
||||
|
||||
```
|
||||
avalue1 not found in { bvalue1: 'bvalue1', bvalue2: 'bvalue2' }. Attempting to re-use incompatible enums
|
||||
```
|
||||
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import fbt from "fbt";
|
||||
|
||||
function Component({ a, b }) {
|
||||
return (
|
||||
<fbt desc="Description">
|
||||
<fbt:enum enum-range={["avalue1", "avalue1"]} value={a} />{" "}
|
||||
<fbt:enum enum-range={["bvalue1", "bvalue2"]} value={b} />
|
||||
</fbt>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user