Skip to content

In JSX components, spreading props breaks component's syntax highlighting. #2753

@mithi

Description

@mithi

Information

Description

In JSX components, spreading props breaks component's syntax highlighting.

Code snippet

Test page

Here's Github's version

const Test = () => {
    return (
       <div>
           <Button {...{onClick, disabled}}>
               Click (Wrong Highlighting)
           </Button>
           <Button onClick={onClick} disabled={disabled}>
               Click (Correct highlighting)
           </Button>
       </div>
    )
}

Screenshots (images)

Prism's broken syntax highlighting, breaks the colors of the first component

Screen Shot 2021-02-07 at 7 44 59 PM

Github correctly highlights it, the first component is highlighted correctly

Screen Shot 2021-02-07 at 7 46 05 PM

I have seen the issues regarding Nested objects inside props and I'm thinking they might be related.
#2598
#1548

Is this expected / known behavior, and is this going to be fixed at all? Thanks!

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