mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
JSX: children which are jsx elements dont need expr container
This commit is contained in:
@@ -955,6 +955,10 @@ function codegenJsxElement(
|
||||
case "StringLiteral": {
|
||||
return t.jsxText(value.value);
|
||||
}
|
||||
case "JSXElement":
|
||||
case "JSXFragment": {
|
||||
return value;
|
||||
}
|
||||
default: {
|
||||
return t.jsxExpressionContainer(value);
|
||||
}
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ function Component(props) {
|
||||
}
|
||||
t1 = (
|
||||
<fbt desc={"Dialog to show to user"}>
|
||||
Hello {<fbt:param name={"user name"}>{t0}</fbt:param>}
|
||||
Hello <fbt:param name={"user name"}>{t0}</fbt:param>
|
||||
</fbt>
|
||||
);
|
||||
$[0] = props.name;
|
||||
|
||||
@@ -22,7 +22,7 @@ function Component(props) {
|
||||
if (c_0) {
|
||||
t0 = (
|
||||
<fbt desc={"Dialog to show to user"}>
|
||||
Hello {<fbt:param name={"user name"}>{props.name}</fbt:param>}
|
||||
Hello <fbt:param name={"user name"}>{props.name}</fbt:param>
|
||||
</fbt>
|
||||
);
|
||||
$[0] = props.name;
|
||||
|
||||
+5
-1
@@ -28,7 +28,11 @@ function Component(props) {
|
||||
if (c_0) {
|
||||
const x = makeOptionalFunction(props);
|
||||
|
||||
t0 = x?.(<div>{<span>{props.text}</span>}</div>);
|
||||
t0 = x?.(
|
||||
<div>
|
||||
<span>{props.text}</span>
|
||||
</div>
|
||||
);
|
||||
$[0] = props;
|
||||
$[1] = t0;
|
||||
} else {
|
||||
|
||||
+5
-1
@@ -34,7 +34,11 @@ function Component(props) {
|
||||
t0 = $[1];
|
||||
}
|
||||
const onChange = t0;
|
||||
return <form>{<input onChange={onChange} value={name} />}</form>;
|
||||
return (
|
||||
<form>
|
||||
<input onChange={onChange} value={name} />
|
||||
</form>
|
||||
);
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user