Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSX spread operator breaks highlighting #1061

Closed
markerikson opened this issue Nov 22, 2016 · 3 comments
Closed

JSX spread operator breaks highlighting #1061

markerikson opened this issue Nov 22, 2016 · 3 comments

Comments

@markerikson
Copy link

If the JSX spread operator is used inside a tag, highlighting breaks starting at that point. Example code to be highlighted:

class MyComponent extends Component
    render() {
        const {tabs, ...otherProps} = this.props;
        const {currentTab} = this.state;
        
        return (
            <TabBar
                {...otherProps}
                currentTab={currentTab}
                onTabClick={this.onTabClick}
                tabs={tabs}
            />
        )
    }

If {...otherProps} is there, the props after that are not highlighted. If {...otherProps} is removed, they highlight correctly:

prism-jsx-broken
prism-jsx-correct

@gre
Copy link

gre commented Nov 22, 2016

👍

I was about to raise something similar for JSX and comments:

screen shot 2016-11-22 at 09 27 09

screen shot 2016-11-22 at 09 26 47

tell me if you prefer to create another issue, but there are multiple ways like this that breaks highlighting.

@Golmote
Copy link
Contributor

Golmote commented Nov 22, 2016

@vkbansal: Can you investigate this?

@vkbansal
Copy link
Contributor

@Golmote I'll try it over the weekend

@Golmote Golmote closed this as completed in 561bceb Feb 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants