mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[compiler][fixtures] Repro for fbt + non-ascii strings
ghstack-source-id: 0521198056
Pull Request resolved: https://github.com/facebook/react/pull/30386
This commit is contained in:
+36
@@ -0,0 +1,36 @@
|
||||
|
||||
## Input
|
||||
|
||||
```javascript
|
||||
import fbt from "fbt";
|
||||
|
||||
function Component(props) {
|
||||
const element = (
|
||||
<fbt desc={"Dialog to show to user"}>
|
||||
Hello{" "}
|
||||
<fbt:param
|
||||
name="a really long description
|
||||
that got split into multiple lines"
|
||||
>
|
||||
{props.name}
|
||||
</fbt:param>
|
||||
</fbt>
|
||||
);
|
||||
return element.toString();
|
||||
}
|
||||
|
||||
export const FIXTURE_ENTRYPOINT = {
|
||||
fn: Component,
|
||||
params: [{ name: "Jason" }],
|
||||
};
|
||||
|
||||
```
|
||||
|
||||
|
||||
## Error
|
||||
|
||||
```
|
||||
Cannot read properties of undefined (reading 'replace')
|
||||
```
|
||||
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
import fbt from "fbt";
|
||||
|
||||
function Component(props) {
|
||||
const element = (
|
||||
<fbt desc={"Dialog to show to user"}>
|
||||
Hello{" "}
|
||||
<fbt:param
|
||||
name="a really long description
|
||||
that got split into multiple lines"
|
||||
>
|
||||
{props.name}
|
||||
</fbt:param>
|
||||
</fbt>
|
||||
);
|
||||
return element.toString();
|
||||
}
|
||||
|
||||
export const FIXTURE_ENTRYPOINT = {
|
||||
fn: Component,
|
||||
params: [{ name: "Jason" }],
|
||||
};
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
|
||||
## Input
|
||||
|
||||
```javascript
|
||||
import fbt from "fbt";
|
||||
|
||||
function Component(props) {
|
||||
const element = (
|
||||
<fbt desc={"Dialog to show to user"}>
|
||||
Hello <fbt:param name='"user" name'>{props.name}</fbt:param>
|
||||
</fbt>
|
||||
);
|
||||
return element.toString();
|
||||
}
|
||||
|
||||
export const FIXTURE_ENTRYPOINT = {
|
||||
fn: Component,
|
||||
params: [{ name: "Jason" }],
|
||||
};
|
||||
|
||||
```
|
||||
|
||||
|
||||
## Error
|
||||
|
||||
```
|
||||
Property arguments[0] of CallExpression expected node to be of a type ["Expression","SpreadElement","JSXNamespacedName","ArgumentPlaceholder"] but instead got "JSXExpressionContainer"
|
||||
```
|
||||
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
import fbt from "fbt";
|
||||
|
||||
function Component(props) {
|
||||
const element = (
|
||||
<fbt desc={"Dialog to show to user"}>
|
||||
Hello <fbt:param name='"user" name'>{props.name}</fbt:param>
|
||||
</fbt>
|
||||
);
|
||||
return element.toString();
|
||||
}
|
||||
|
||||
export const FIXTURE_ENTRYPOINT = {
|
||||
fn: Component,
|
||||
params: [{ name: "Jason" }],
|
||||
};
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
|
||||
## Input
|
||||
|
||||
```javascript
|
||||
import fbt from "fbt";
|
||||
|
||||
function Component(props) {
|
||||
const element = (
|
||||
<fbt desc={"Dialog to show to user"}>
|
||||
Hello <fbt:param name="user name ☺">{props.name}</fbt:param>
|
||||
</fbt>
|
||||
);
|
||||
return element.toString();
|
||||
}
|
||||
|
||||
export const FIXTURE_ENTRYPOINT = {
|
||||
fn: Component,
|
||||
params: [{ name: "Jason" }],
|
||||
};
|
||||
|
||||
```
|
||||
|
||||
|
||||
## Error
|
||||
|
||||
```
|
||||
Property arguments[0] of CallExpression expected node to be of a type ["Expression","SpreadElement","JSXNamespacedName","ArgumentPlaceholder"] but instead got "JSXExpressionContainer"
|
||||
```
|
||||
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
import fbt from "fbt";
|
||||
|
||||
function Component(props) {
|
||||
const element = (
|
||||
<fbt desc={"Dialog to show to user"}>
|
||||
Hello <fbt:param name="user name ☺">{props.name}</fbt:param>
|
||||
</fbt>
|
||||
);
|
||||
return element.toString();
|
||||
}
|
||||
|
||||
export const FIXTURE_ENTRYPOINT = {
|
||||
fn: Component,
|
||||
params: [{ name: "Jason" }],
|
||||
};
|
||||
Reference in New Issue
Block a user