Skip to content

[Compiler Bug]: Unicode characters handled incorrectlyΒ #32915

Open
@JCown

Description

@JCown

What kind of issue is this?

  • React Compiler core (the JS output is incorrect, or your app works incorrectly after optimization)
  • babel-plugin-react-compiler (build issue installing or using the Babel plugin)
  • eslint-plugin-react-compiler (build issue installing or using the eslint plugin)
  • react-compiler-healthcheck (build issue installing or using the healthcheck script)

Link to repro

https://playground.react.dev/#N4Igzg9grgTgxgUxALhAgHgBwjALgAgBMEAzAQygBsCSoA7OXASwjvwFkBPAQU0wAoAlPmAAdNvhgJcsNv3H5F+ADxcAwhAC22OgjoFcGXAF5RIAO4JKcLQnyBeDcDSO2fwB6AHwL8ggNziAvuJBulg4BDZ0YATqWjp6BMb4-JgwEJhgwsbuIl5SMjBsyoRMAG7uwClpYAB0hui4-g6Oyq7FZQEg-kA

Repro steps

When passing a unicode character as a prop, like <MyComponent text="welcome πŸ‘‹" /> then in RC output code we can see <MyComponent text="welcome \uD83D\uDC4B" /> - unicode character gets replaced by "stringified" UTF-16 representation of it.

Expected result (on the screen)
Welcome πŸ‘‹

Actual result:
Welcome \uD83D\uDC4B

How often does this bug happen?

Every time

What version of React are you using?

19.1

What version of React Compiler are you using?

19.0.0-beta-ebf51a3-20250411

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions