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

Allow props to take a JSX literal value #14

Open
felipeochoa opened this issue Nov 7, 2016 · 4 comments
Open

Allow props to take a JSX literal value #14

felipeochoa opened this issue Nov 7, 2016 · 4 comments
Labels

Comments

@felipeochoa
Copy link
Owner

Also per the spec on the repo, apparently props can be assigned literal JSX elements directly

JSXAttributeInitializer :


  • = JSXAttributeValue

JSXAttributeValue :


  • " JSXDoubleStringCharactersopt "
  • ' JSXSingleStringCharactersopt '
  • { AssignmentExpression }
  • JSXElement
@felipeochoa felipeochoa added the bug label Nov 7, 2016
@wyuenho
Copy link
Contributor

wyuenho commented May 13, 2018

This isn't hard at all, the hardest part is to not mess up indentation even more than it is now. js-mode's indent-line-function is just superbly stupid even in Emacs 26.

It'll probably make more sense to reimplement indent-line-function first.

@wyuenho
Copy link
Contributor

wyuenho commented May 17, 2018

Oh well, no need to hurry tho, not until Babel 7 is released anyway, whenever that maybe.

@wyuenho
Copy link
Contributor

wyuenho commented Aug 28, 2018

It's released! https://babeljs.io/blog/2018/08/27/7.0.0

@felipeochoa
Copy link
Owner Author

PRs welcome :) I think it's an easy fix on the parsing side, we just need some tests here. On the indentation side, I'd have to check, but I think there's an assumption that if a node and its parent are both rjsx-nodes, then it's a nested relationship rather than a tag-attribute relationship. If only I'd added an rjsx-tag node to the parse tree...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants