[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: 6d9c8e4dd22285077108e2fa53d66154d1b781fb Pull Request resolved: https://github.com/facebook/react/pull/33096
Showing
- compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/CodegenReactiveFunction.ts 4 additions, 1 deletion...ct-compiler/src/ReactiveScopes/CodegenReactiveFunction.ts
- compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-string-attribute-expression-container.expect.md 3 additions, 1 deletion...piler/jsx-string-attribute-expression-container.expect.md
- compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/jsx-string-attribute-expression-container.js 1 addition, 0 deletions...res/compiler/jsx-string-attribute-expression-container.js
Please register or sign in to comment