Skip to content

Compiler: Unexpected token error when using double quotes Inside single-quoted JSX prop #29069

@damianstasik

Description

@damianstasik

React version: 19 RC

Steps To Reproduce

Use double quote mark in single-quoted JSX string prop like so:

export function Component() {
  return (<Message caption='Some "text"' />);
}

and you'll get this error:

Screenshot 2024-05-15 at 20 31 15

Link to code example:

https://playground.react.dev/#N4Igzg9grgTgxgUxALhAgHgBwjALgAgDMoA7OXASwhPwGEIBbbEhE3ACgEp9gAdG-DAS5YNdgB4AsgjBgAhgHME+OHMyVqAXgDkAZUbLeIXBlxHt+APQA+TgG5+AXxCOgA

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