mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
compiler: fix jsx text attributes with double quotes (#29079)
Fixes #29069 by detecting the presence of double-quotes in JSX attribute strings and falling back to using an expression container.
This commit is contained in:
+3
@@ -2040,6 +2040,9 @@ function codegenJsxAttribute(
|
||||
switch (innerValue.type) {
|
||||
case "StringLiteral": {
|
||||
value = innerValue;
|
||||
if (value.value.indexOf('"') !== -1) {
|
||||
value = createJsxExpressionContainer(value.loc, value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
||||
Reference in New Issue
Block a user