Commit ac2cae5
committed
[compiler] Fix for string attribute values with emoji
If a JSX attribute value is a string that contains unicode or other characters that need special escaping, we wrap the attribute value in an expression container. However, our unicode to detect this only handled the basic unicode character plane, not the "astral" plane which includes emojis.
This PR updates the regex to detect such extended characters and also use an expression container.
ghstack-source-id: 6d9c8e4
Pull Request resolved: #330961 parent 66de8e5 commit ac2cae5
File tree
3 files changed
+8
-2
lines changed- compiler/packages/babel-plugin-react-compiler/src
- ReactiveScopes
- __tests__/fixtures/compiler
3 files changed
+8
-2
lines changedLines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2327 | 2327 | | |
2328 | 2328 | | |
2329 | 2329 | | |
| 2330 | + | |
| 2331 | + | |
| 2332 | + | |
2330 | 2333 | | |
2331 | 2334 | | |
2332 | | - | |
| 2335 | + | |
2333 | 2336 | | |
2334 | 2337 | | |
2335 | 2338 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| |||
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
77 | | - | |
| 79 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
0 commit comments