-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: Bug highlighting object spread with object property access #1236
Comments
I spy |
Thanks for reporting. It should be fixed now. Note, though, that Prism will still fail on other cases. AFAIK JSX can contain almost all JS has to offer in those tags, and matching everything would be really complicated with just regexps. Examples that will fail, and I think we won't fix, include: // Spread with anything other than a variable or a simple property access
<Child {...{foo: 'bar', bar: 'baz'}}> // Nested objects in attribute value
<Child foo={{ foo: { bar: 'baz'}}}> I'm not even sure those are valid JSX example, but I do know they would fail. |
Really appreciate the fix @Golmote, hyper merci |
Reproducing The Issue
Spread over a nested object as component props, such as
{...this.props}
below:. . .
Test Drive Results
The highlighting for the line
<Child {...this.props} option={400}>
is a bit off.. . .
If we don't use the object property access operator, and replace
this.props
withsomePropsObj
for example, we can see how the highlighting kicks back in:. . .
Related: #1235
The text was updated successfully, but these errors were encountered: