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

Issue with syntax highlighting components that take functions as props. #412

Closed
jackfranklin opened this issue Sep 13, 2017 · 2 comments
Closed

Comments

@jackfranklin
Copy link

Firstly, thank you so much for your work on this plugin. It's made working in Atom an absolute dream!

I've just come across what I think might be a very edge case syntax highlighting issue. It occurs when you have a component that you're passing in a function as a prop, and that function is an arrow function that returns another JSX element via an implicit return.

It's hard to describe, so I took screenshots! Here's the broken version - note that the children prop is an arrow function with an implicit return, and note that the syntax highlighting is off.

screen shot 2017-09-13 at 18 22 45

Here's a version where the arrow function is an explicitly returning one - it has a body wrapped in braces, and you can see the syntax highlighting is working correctly:

screen shot 2017-09-13 at 18 22 31

Additionally, if I take the broken first example and put the children prop onto its own line, that fixes the highlighting too:

screen shot 2017-09-13 at 18 25 45

It's a very edge case and easily avoided, but thought I'd raise the issue :)

@jackfranklin jackfranklin changed the title Issue with syntax highlighting components that take propFns Issue with syntax highlighting components that take functions as props. Sep 13, 2017
@gandm gandm closed this as completed in 7610ca1 Sep 13, 2017
@gandm
Copy link
Owner

gandm commented Sep 13, 2017

Thanks for the report and kind words.

@jackfranklin
Copy link
Author

Thank you so much for such a quick response!

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

2 participants